Skip to content
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

Closed

Conversation

@ScalaFanatic
Copy link
Contributor

ScalaFanatic commented Nov 6, 2019

As discussed in #2943, it works with both HTTP/1 and HTTP/2.

@ScalaFanatic

This comment has been minimized.

Copy link
Contributor Author

ScalaFanatic commented Nov 6, 2019

The scalafix error is

[error] [launcher] could not retrieve Scala 2.12.10: missing scala.Option

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.
Edit: am I wrong? scalafix failed again for the same reason.
Edit 2: Another unrelated test failed after rebuilding, so third time's the charm?
Edit 3: I guess not. Looks like others are experiencing this though.


"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))

This comment has been minimized.

Copy link
@kevinmeredith

kevinmeredith Nov 10, 2019

Contributor

Does your test require specifying the HTTP version when constructing the Request?

This comment has been minimized.

Copy link
@ScalaFanatic

ScalaFanatic Nov 10, 2019

Author Contributor

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.

This comment has been minimized.

Copy link
@kevinmeredith

kevinmeredith Nov 26, 2019

Contributor

👍

request.cookies mustEqual cookieList
}

"parse HTTP/1 and HTTP/2 Cookie headers on a single request into corresponding RequestCookies" in {

This comment has been minimized.

…ent-request-cookies
rossabaker added a commit that referenced this pull request Nov 26, 2019
@rossabaker

This comment has been minimized.

Copy link
Member

rossabaker commented Nov 26, 2019

This is backported into #2992.

@rossabaker rossabaker closed this Nov 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.