-
Notifications
You must be signed in to change notification settings - Fork 519
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
fix: websocket multi-value connection upgrades #489
fix: websocket multi-value connection upgrades #489
Conversation
5aa8893
to
7c82ab3
Compare
Thank you for the fix! Could you change the commit description to:
This just makes it more consistent with the other commits in Ring. |
7c82ab3
to
c0a5e3a
Compare
@weavejester Done! Also changed the impl to handle |
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.
So I reviewed this a few days ago, but I forgot to submit the review, and only just noticed that my comment had "Pending" attached to it. So many apologies for the late response.
ring-core/src/ring/websocket.clj
Outdated
(let [headers (:headers request) | ||
conn-header (get headers "connection") | ||
upgrade-header (get headers "upgrade")] | ||
(and conn-header | ||
upgrade-header | ||
(re-find #"\b(?i)upgrade\b" conn-header) | ||
(.equalsIgnoreCase "websocket" upgrade-header)))) |
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.
What about:
(let [{{:strs [connection upgrade]} :headers} request]
(and connection upgrade
(re-find #"\b(?i)upgrade\b" connection)
(.equalsIgnoreCase "websocket" upgrade)))
Just makes it a little neater and more concise.
No problem at all! Yours looks good! I can submit an amended commit tomorrow (about 12 hours) or you're welcome to commit whatever you feel is best. Cheers! |
Fix an issue where browsers could send Keep-Alive and Upgrade in the same request causing upgrade-request? to return false.
c0a5e3a
to
a24d724
Compare
@weavejester I've submitted a new commit with the suggested implementation. Thanks again! |
Fixes an issue where browsers could send
keep-alive
andUpgrade
in the same request causing thews/upgrade-request?
to return false.