-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Implement support for rack.protocol
.
#3399
Conversation
Do you mind providing some more background on this? For anyone that hasn't followed along with the latest Rack developments. Any links to discussions/issues are appreciated too. |
It has been discussed here: rack/rack#1946 and there are linked issues/discussions which provide more context. |
headers['upgrade'] = protocol | ||
headers['connection'] = 'upgrade' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could make these string constants if preferred.
610c921
to
79c7ced
Compare
@@ -104,6 +108,12 @@ def handle_request(client, requests) | |||
status, headers, app_body = [501, {}, ["#{env[REQUEST_METHOD]} method is not supported"]] | |||
end | |||
|
|||
if protocol = headers.delete(RACK_PROTOCOL) | |||
status = 101 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's advisable we force the status code here. HTTP/2 uses 200 Ok
but HTTP/1 uses 101... There is no reason to use anything other than 101 AFAIK.
Unrelated failure (last mentioned here):
That seems... odd? |
7011958
to
d9c50ae
Compare
Rack 3.1 was released with |
Actually, after consideration, I updated |
Description
Implement support for
rack.protocol
which is an optional feature of Rack 3.1, required to supportprotocol-websocket
.Your checklist for this pull request
[ci skip]
to the title of the PR.#issue
" to the PR description or my commit messages.