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

431 and 414 responses sent by hyper or h2 never reach the Service, so metrics middleware can't record them

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

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
35/100
Loại issue
Tính năng
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Sôi nổi
Công nghệ
rust
Lĩnh vực
backend-api-design

Hướng nghiên cứu

Start by reading the hyper and h2 rejection paths named in the issue: proto/h1/role.rs and proto/streams/streams.rs. Trace how each path produces a 431 or 414 and consider where the server could expose the status to applications. Done means an application can observe these responses, including their status codes, for both HTTP/1.1 and HTTP/2.

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

Mô tả

C-feature

Is your feature request related to a problem? Please describe.

When a request is too large for the server's limits, hyper (HTTP/1.1) or h2 (HTTP/2) writes the error response itself, and the request never reaches the Service. Middleware that records each request never sees these responses, for e.g. an OpenTelemetry histogram or a tracing span.

Here's what is observable today (hyper 1.12.0, h2 0.4.20):

Protocol Rejection Who responds What the application gets
HTTP/1.1 More than max_headers headers, or a head larger than max_buf_size hyper, 431 (Server::on_error in proto/h1/role.rs) The connection future returns Err, and is_parse_too_large() is true
HTTP/1.1 URI longer than 65,534 bytes hyper, 414 The same: is_parse_too_large() is true. Only the Display text, "URI too long", distinguishes it from the 431
HTTP/2 Header list larger than max_header_list_size h2, 431 followed by RST_STREAM (Streams::recv_headers in proto/streams/streams.rs) Nothing. The connection keeps serving other streams and ends with Ok(())

For HTTP/1.1 we can approximate a metric from the connection error. To tell a 414 from a 431, though, we have to match on the error's Display string, and we have none of the request's attributes, such as its method. For HTTP/2 there is nothing to hook into: no error, event or callback reaches hyper or the application when h2 answers with a 431.

Describe the solution you'd like

Some way for a server application to learn that hyper or h2 answered a request on its own, and with which status code - not entirely sure what this should look like yet.

Describe alternatives you've considered

Not aware of any other ways to solve this yet

Ngôn ngữ chính
Rust
Star
16.4k
Fork
1.8k
Merge trung bình
1 ngày 13 giờ
Pull request đã merge (30 ngày)
12

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 hyperium/hyper

Tất cả issue của hyperium/hyper

Issue tương tự

Thêm issue về Rust

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.