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
wants to merge 2 commits into from
Closed

Add a Request.cookies function #2965

wants to merge 2 commits into from

Conversation

ghost
Copy link

@ghost ghost commented Nov 6, 2019

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

@ghost
Copy link
Author

@ghost ghost 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.

@ghost ghost closed this Nov 6, 2019
@ghost ghost reopened this Nov 6, 2019
@ghost ghost closed this Nov 6, 2019
@ghost ghost reopened this Nov 6, 2019

"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))
Copy link
Contributor

@kevinmeredith kevinmeredith Nov 10, 2019

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?

Copy link
Author

@ghost ghost Nov 10, 2019

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.

Copy link
Contributor

@kevinmeredith kevinmeredith Nov 26, 2019

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 {
Copy link
Contributor

@kevinmeredith kevinmeredith Nov 10, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rossabaker
Copy link
Member

@rossabaker 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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants