HTTP/2 headers should not be included in snippets
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- typescript
- Lĩnh vực
- tooling
Hướng nghiên cứu
Bắt đầu bằng cách theo dõi cách dữ liệu HAR được tải vào các header của request và cách các header đó được truyền cho các trình tạo snippet. Tái hiện input HAR HTTP/2 mẫu và so sánh output curl được tạo ra, sau đó xác minh rằng các pseudo-header như :authority và :method được loại trừ mà không xóa các header thông thường.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
It doesn't seem to be explicitly specified anywhere, but when exporting a HAR file for HTTP/2 traffic, it seems that most clients (e.g. Chrome) do include the HTTP/2 pseudo-headers in the header data. These are headers like :authority and :method.
This makes sense for HAR files, when you want an accurate recording of the full traffic details, but these shouldn't be included in HTTP snippets imo. Most clients will reject them completely, for example this curl command generated by httpsnippet will always fail, even though the original request worked fine:
curl --request GET \
--url https://google.com/ \
--header ':authority: google.com' \
--header ':method: GET' \
--header ':path: /' \
--header ':scheme: https' \
--header 'accept: */*' \
--header 'user-agent: curl/7.68.0'
These headers are basically duplicating the method & URL parts, which we include separately anyway. They're just a detail of how the method & URL are sent in HTTP/2. They also won't work because I think in every snippet here we're sending pure HTTP/1 requests, where these are generally illegal header names anyway (which I guess is why curl fails here).
I would suggest we filter these out, i.e. drop all headers starting with : when we load data from the HAR. That will never happen in HTTP/1 traffic, and in HTTP/2 traffic it's almost always redundant, and the rare cases where it's not are very weird (I think sending a request to one domain but with a :authority header for different domain is the only possible example?).
Alternatively, we could try to fully translate HTTP/2 data back into the exactly equivalent HTTP/1 requests. I wrote a blog post about that a while back here: https://httptoolkit.tech/blog/translating-http-2-into-http-1/#translating-one-to-the-other. That would just be the first HTTP/2 -> HTTP/1 list, under 'Translating one to the other', and only half are relevant, so I think it's relatively simple, but it's still more complicated than just dropping the headers, and it might plausibly have other side effects.
What do you think?
- Ngôn ngữ chính
- TypeScript
- Star
- 1.2k
- Fork
- 245
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của Kong/httpsnippet
-
BUG: Http default clientId errorĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 62/100
Kong/httpsnippet#356 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
Kong/httpsnippet#397 ·
-
v3.0.9 Bug: Can't resolve 'fs'Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
Kong/httpsnippet#389 ·
-
Support for Oracle APEXĐang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
Kong/httpsnippet#383 ·
-
Bug: R Code Generation Does Not Quote Parameters with Special Characters (e.g., `codes[]`)Có thể đã có người làm @abansal21 đã nhận 499 ngày trước. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
Kong/httpsnippet#379 ·
Tất cả issue của Kong/httpsnippet
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Maintainer thường phản hồi trong vòng 1 ngày
-
rel: fix
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Deltares/fews-web-oc#2400 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
ardia-browser/ardia#4426 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Bug report: isValidISODateDashOnly accepts text before or after the date-timeCó thể đã có người làm @bardrop đã nhận hôm nay. Đang mở
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 88/100
pnp/cli-microsoft365#7713 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Diagram: Journey Type: Bug / Error
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
mermaid-js/mermaid-v13#1293 ·
Maintainer thường phản hồi trong vòng 1 ngày