Visitar URL original
Hyper should skip automatic Content-Length header for HTTP 1xx responses · Issue #2215 · hyperium/hyper · GitHub
Skip to content

Hyper should skip automatic Content-Length header for HTTP 1xx responses #2215

Closed

Description

@psmit

Similar to issue #1797 hyper should not set a content-length header for a number of different scenario's. Quoting RFC 7230, section 3.3.2 6th paragraph:

A server MUST NOT send a Content-Length header field in any response
with a status code of 1xx (Informational) or 204 (No Content). A
server MUST NOT send a Content-Length header field in any 2xx
(Successful) response to a CONNECT request (Section 4.3.6 of
[RFC7231]).

At this moment the content-length header is set for 101 Switch Protocols responses. The resulting issue is that e.g. with a warp WebSocket server, a .Net client will drop the connection after 100 seconds: https://stackoverflow.com/a/44553521/85514 .

I believe the solution should be similar to [b342c38], and I'm willing to make a PR to do that. However, I'm not familiar enough with the code base to see if that would fix the problem / has any other implications.

Activity

  1. added 3 commits that reference this issue on Jun 3, 2020
    4323493
    f7ceff8
    4570076
  2. added
    A-http1Area: HTTP/1 specific.
    E-easyEffort: easy. A task that would be a great starting point for a new contributor.
    on Jul 29, 2020
  3. added a commit that references this issue on Jul 29, 2020
    bb8e341
  4. added a commit that references this issue on Mar 5, 2021
    8cbf952
  5. added a commit that references this issue on Jul 26, 2021
    4e8419d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-http1Area: HTTP/1 specific.A-serverArea: server.E-easyEffort: easy. A task that would be a great starting point for a new contributor.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions