-
Notifications
You must be signed in to change notification settings - Fork 33
Don't advertise support for non-working connection upgrade. #137
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
Conversation
e136f27 to
c73e0b4
Compare
|
I have confirmed this fix is sufficient. For more context, in theory, we should also remove |
|
I don't see why Pitchfork should remove headers like this. If the app want to receive such headers it's fine by me. |
|
The reason is, because it's nice to correctly advertise the capabilities of the server to the client application, and it's a good idea to follow the RFCs. In the current scenario, a valid upgrade request can generate an invalid upgrade response due to the following code insisting on pitchfork/lib/pitchfork/http_response.rb Line 53 in 79ba8e9
The RFCs specify how servers should behave: https://datatracker.ietf.org/doc/html/rfc7230#section-6.7
ExamplePitchfork will generate the following response: which is invalid according the RFC. I see various options to rectify this:
For the sake of simplicity, option 2 actually seems better to me. |
IMO this has nothing to do with server capabilities.
That's for the application to do that. I'm not gonna lie to the application. It's the app responsability to ignore the upgrade. I really see no problem here. |
How does the app know that the server doesn't support upgrade responses? In other words, how should rack-conform know that pitchfork won't correctly feed the response headers to the client? |
|
Just mark it as unsupported in your test matrix. |
|
Okay. FYI, I consider this broken behaviour. |
|
FYI, I don't. |
As discussed here: socketry/rack-conform#24