Kong / Kong/httpsnippet

Content-Length invalid for unicode text

オープン
#332 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
TypeScript
スター
1.2k
フォーク
242
PR マージ指標
30日以内にマージされた PR はありません

説明

When generating a http request string, the content-length seems to be calculated using the number of codepoints instead of bytes.
This was generated using insomnia, which uses httpsnippet:
```
POST /api/v1/test HTTP/1.1
Content-Type: text/plain
User-Agent: insomnia/2023.5.8
Host: localhost:5003
Content-Length: 3

äöü
```

This is what insomnia actually sends when executing the request (visualized using nc -l localhost 5003)
```
$ nc -l localhost 5003
POST /api/v1/test HTTP/1.1
Host: localhost:5003
Content-Type: text/plain
User-Agent: insomnia/2023.5.8
Accept: */*
Content-Length: 6

äöü
```

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

Start by tracing the code that generates the HTTP request string and calculates Content-Length, then check how Unicode text is encoded. Add a regression test using äöü and verify that the generated length matches the UTF-8 byte count.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
typescript
領域
api
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
38/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。