-
-
Notifications
You must be signed in to change notification settings - Fork 88
Quote cookie values #73
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
According to [RFC2019](https://tools.ietf.org/html/rfc2109), this is required for values containing spaces, and should always be safe for non-space containing values. Note that most webservers are quite smart and lenient when parsing cookie headers. This change however is still useful for servers that are very strict (such as undertow).
jodersky
added a commit
to com-lihaoyi/cask
that referenced
this pull request
Dec 26, 2020
Undertow's cookie handling changed slightly in this version, which prompted two changes: 1. the SameSite cookie no longer accepts null as an argument. Rather than adding conditionals to guard setting, we simply change the default SameSite value to 'Lax', as is required by modern standards anyway https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie/SameSite: > Cookies with SameSite=None must now also specify the Secure > attribute (they require a secure context/HTTPS). 2. it no longer handles spaces in cookie values (unless they are quoted). This behavior is actually correct according to [RFC2109]https://tools.ietf.org/html/rfc2109, which requires cookie values to be quoted if they contain spaces. This change is actually transparent to cask, but reveals a bug in the [requests-scala](com-lihaoyi/requests-scala#73) library. Tests pass locally once this issue is fixed.
jodersky
added a commit
to com-lihaoyi/cask
that referenced
this pull request
Dec 26, 2020
Undertow's cookie handling changed slightly in this version, which prompted two changes: 1. the SameSite cookie no longer accepts null as an argument. Rather than adding conditionals to guard setting, we simply change the default SameSite value to 'Lax', as is assumed by modern standards anyway https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie/SameSite: > Cookies with SameSite=None must now also specify the Secure > attribute (they require a secure context/HTTPS). 2. it no longer handles spaces in cookie values (unless they are quoted). This behavior is actually correct according to [RFC2109](https://tools.ietf.org/html/rfc2109), which requires cookie values to be quoted if they contain spaces. This change is actually transparent to cask, but reveals a minor bug in the [requests-scala](com-lihaoyi/requests-scala#73) library. Tests pass locally once this issue is fixed.
jodersky
added a commit
to com-lihaoyi/cask
that referenced
this pull request
Dec 26, 2020
Undertow's cookie handling changed slightly in this version, which prompted two changes: 1. the SameSite cookie no longer accepts null as an argument. Rather than adding conditionals to guard setting, we simply change the default SameSite value to 'Lax', as is assumed by modern standards anyway https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie/SameSite: > The cookie-sending behavior if SameSite is not specified is SameSite=Lax. > Previously the default was that cookies were sent for all requests. 2. it no longer handles spaces in cookie values (unless they are quoted). This behavior is actually correct according to [RFC2109](https://tools.ietf.org/html/rfc2109), which requires cookie values to be quoted if they contain spaces. This change is actually transparent to cask, but reveals a minor bug in the [requests-scala](com-lihaoyi/requests-scala#73) library. Tests pass locally once this issue is fixed.
jodersky
added a commit
to com-lihaoyi/cask
that referenced
this pull request
Jan 2, 2021
Undertow's cookie handling changed slightly in this version, which prompted two changes: 1. the SameSite cookie no longer accepts null as an argument. Rather than adding conditionals to guard setting, we simply change the default SameSite value to 'Lax', as is assumed by modern standards anyway https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie/SameSite: > The cookie-sending behavior if SameSite is not specified is SameSite=Lax. > Previously the default was that cookies were sent for all requests. 2. it no longer handles spaces in cookie values (unless they are quoted). This behavior is actually correct according to [RFC2109](https://tools.ietf.org/html/rfc2109), which requires cookie values to be quoted if they contain spaces. This change is actually transparent to cask, but reveals a minor bug in the [requests-scala](com-lihaoyi/requests-scala#73) library. Tests pass locally once this issue is fixed.
jodersky
added a commit
to com-lihaoyi/cask
that referenced
this pull request
Jan 2, 2021
Undertow's cookie handling changed slightly in this version, which prompted two changes: 1. the SameSite cookie no longer accepts null as an argument. Rather than adding conditionals to guard setting, we simply change the default SameSite value to 'Lax', as is assumed by modern standards anyway https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie/SameSite: > The cookie-sending behavior if SameSite is not specified is SameSite=Lax. > Previously the default was that cookies were sent for all requests. 2. it no longer handles spaces in cookie values (unless they are quoted). This behavior is actually correct according to [RFC2109](https://tools.ietf.org/html/rfc2109), which requires cookie values to be quoted if they contain spaces. This change is actually transparent to cask, but reveals a minor bug in the [requests-scala](com-lihaoyi/requests-scala#73) library. Tests pass locally once this issue is fixed.
Thanks @jodersky! Let me know if you'd like me to tag a new release and i'll do so |
It's not super urgent on my side. It can wait and be bundled with another Scala 3 milestone release |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
According to RFC2019, this is required for values containing spaces, and is always safe for non-space containing values.
Note that most webservers are quite smart and lenient when parsing cookie headers. This change however is still useful for servers that are very strict (such as undertow).