Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle 100-continue properly in HTTP/2 #190

Open
fasterthanlime opened this issue Jun 4, 2024 · 1 comment
Open

Handle 100-continue properly in HTTP/2 #190

fasterthanlime opened this issue Jun 4, 2024 · 1 comment

Comments

@fasterthanlime
Copy link
Collaborator

RFC 9113 8.8.5 Gives examples of 100-continue:

  HTTP/1.1 100 Continue            HEADERS
  Extension-Field: bar       ==>     - END_STREAM
                                     + END_HEADERS
                                       :status = 100
                                       extension-field = bar

  HTTP/1.1 200 OK                  HEADERS
  Content-Type: image/jpeg   ==>     - END_STREAM
  Transfer-Encoding: chunked         + END_HEADERS
  Trailer: Foo                         :status = 200
                                       content-type = image/jpeg
  123                                  trailer = Foo
  {binary data}
  0                                DATA
  Foo: bar                           - END_STREAM
                                   {binary data}

                                   HEADERS
                                     + END_STREAM
                                     + END_HEADERS
                                       foo = bar

...mostly as an example of how to translate HTTP/1.1? I suppose that's a question for HTTP/1 => HTTP/2 proxies, which.. doesn't happen that often? I don't know. There's not a fully-featured proxy built on top of fluke right now anyway, only trivial ones, so that's a question for later, but: for now, H2Encoder::write_response has this assert:

        // TODO: don't panic here
        assert!(
            !res.status.is_informational(),
            "http/2 does not support informational responses"
        )

Which is probably wrong.

@fasterthanlime
Copy link
Collaborator Author

That also means in the HTTP/2 client state machine, we shouldn't move on to "expecting body" if we receive an HTTP 1xx response — this may already be the case, I haven't checked, but we should be consistent on both sides.

@fasterthanlime fasterthanlime changed the title Decide how to handle 100-continue in HTTP/2 Handle 100-continue properly in HTTP/2 Aug 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant