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
Add a Request.cookies function #2965
Conversation
The scalafix error is
I guess I will just close and re-open the pull request to trigger another Travis build... I assume this is another one of those flaky issues with Travis. |
|
||
"parse discrete HTTP/1 Cookie header(s) into corresponding RequestCookies" in { | ||
val cookies = Header("Cookie", "test1=value1; test2=value2; test3=value3") | ||
val request = Request(Method.GET, headers = Headers.of(cookies)) |
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.
Does your test require specifying the HTTP version when constructing the Request?
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.
No. That should not impact the way the headers are handled. If I need to add that for semantics, I can, but this specifically refers to the way the cookies are being sent.
In practice, yes, the format would accompany
httpVersion = HttpVersion.`HTTP/2.0`
just because (for example) we would likely not see the HTTP/2 cookie format unless the request is HTTP/2. But for the purposes of my test I do not care about this.
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.
request.cookies mustEqual cookieList | ||
} | ||
|
||
"parse HTTP/1 and HTTP/2 Cookie headers on a single request into corresponding RequestCookies" in { |
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.
…ent-request-cookies
This is backported into #2992. |
As discussed in #2943, it works with both HTTP/1 and HTTP/2.