Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Express returns a non-compliant HTTP/206 response when gzip is enabled

Đang mở
#185 9 bình luận 1 reaction 0 người được giao Xem trên GitHub

@vibhor-aggr đang làm issue này rồi.

Từ ngày 11/6/2026.

  • #277 của @vibhor-aggr — đang mở

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 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ệ
javascript, node.js
Lĩnh vực
backend

Hướng nghiên cứu

Bắt đầu với bản tái hiện nodejs-express-range-headers được liên kết và RFC7233, sau đó theo dõi cách middleware nén xử lý các yêu cầu Range và tạo status cùng các header của response. Hoàn tất khi các response đã nén không còn trả về các giá trị HTTP/206 Content-Range không chính xác; hãy xác minh hành vi bằng một regression test tập trung nếu dự án có cung cấp.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

CDNs (mostly Azure Front Door) is using HTTP Range Requests to retrieve data from Origin when caching enabled.

Express should ignore Range: requests header when gzip compression is in place since Express is unable to respond a HTTP/206 compliant answer with the right computed Content-Range header in the response that is taking the compressed data length into account.

A fair compliant workaround is to, in that very case of compression where computing Content-Range values would be too complex, ignore client's Range: header in the request, and answer the whole compressed content in a HTTP/200 response.

Handling Range: headers is optional so answering a HTTP/200 is OK.

Answering a HTTP/206 with wrong Content-Range values is notOK.

Meanwhile another workaround is to disable compression and make CDN handle it, or disable CDN caching, however it would be fair to expect Express to return a compliant HTTP response in any case.

References:

RFC7233

Details and highlighting Express behavior:

https://github.com/DanielLarsenNZ/nodejs-express-range-headers

Ngôn ngữ chính
JavaScript
Star
2.8k
Fork
261
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

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của expressjs/compression

Tất cả issue của expressjs/compression

Issue tương tự

Thêm issue về JavaScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.