-
-
Notifications
You must be signed in to change notification settings - Fork 300
Requests missing an :authority pseudo-header return PROTOCOL_ERROR #345
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
Nice write-up, I agree with your assessment! (Both that it shouldn't error, and some logs would be nice). |
I hit similar problem related to authority header. Even more controversial. I'm using tower-grpc and k8s api client written in golang. Unix domain socket is used as the transport. golang client library inserts the name of the unix domain socket to authority header (i.e. /var/tmp/some.sock) and h2 fails the request (because slash is not allowed in authority header). I opened a ticket for the client side (grpc/grpc-go#2628) so that they don't set authority header unless they are sure that it is a valid value. If they fix their part and we fix this ticket, then it should be good. Another option would be to fix h2 to be more tolerant and ignore the authority if invalid (or make such behaviour optional based on some configuration flag). Opinions? |
Well, I think we need to figure out who is in the wrong, it might be I think I misinterpreted:
That probably means that |
@jkryl is this something that you can look into. It probably is just a question of finding the code that checks if |
Though, I do think that h2 is correct to throw errors if |
@olix0r hmm, yeah that is a good point (i missed that part). Welp... I guess the question is if we want h2 to be tolerant of spec violations. |
@carllerche |
The HTTP2 spec urged implementors to be strict, to try to battle what happened with HTTP1 becoming a weak mess. I'm in favor of that. |
@seanmonstar I agree. |
Thanks for your opinions 👍 The ticket for go-grpc mentioned above has been flagged as a bug, so there is a good chance that it will be fixed in future. If we just tolerate unspecified authority header, which has been the original intent of this ticket, then we will be fine. |
I tried looking into fixing this, and came out unsure what the exact problem is. Here's what I found:
|
Thanks for looking into this! 👍 It is possible that the issue does not exist. My problem was a bit different and I'm using a temporary fix to work around invalid authority header problem. based on the following comment in client code:
I'm wondering what h2 client will do when support for UDS (unix domain socket) is added in the future. As it seems that authority is always required for http2 but there is no reasonable value to put into the header. Basically the same problem that golang http2 client suffers from. But that is off topic. It might be worth writing a test case that covers missing authority header if there is none. Just my 2 cents. |
We finally found what was happening here. Even though the code in h2 allowed an optional |
Uh oh!
There was an error while loading. Please reload this page.
We are using nghttpx to upgrade requests from HTTP to H2. nghttpx omits the
:authority
pseudo-header when creating the request to forward on via H2, this appears to be consistent with the spec:However, it appears that h2 incorrectly rejects the request with
PROTOCOL_ERROR
when this happens. It also seems like there should also be some logging around this code path, but I couldn't get it to trigger.The text was updated successfully, but these errors were encountered: