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

Parse should accept format RFC 8288 #2967

Merged
merged 2 commits into from Nov 26, 2019

Conversation

@bfdes
Copy link
Contributor

bfdes commented Nov 6, 2019

Fixes #2852.

parsedLink.map(_.rel) must beRight(Option("alternate"))
parsedLink.map(_.title) must beRight(Option("main"))
parsedLink.map(_.`type`) must beRight(Option(MediaRange.`text/*`))
parsedLink.map(_.rev) must beRight(Option("previous"))
}

"accept format RFC 8288" in {

This comment has been minimized.

Copy link
@bfdes

bfdes Nov 6, 2019

Author Contributor

Test data essentially sourced from that posted in #2852.

}
writer
}
final case class Link(values: NonEmptyList[LinkValue]) extends Header.RecurringRenderable {

This comment has been minimized.

Copy link
@bfdes

bfdes Nov 6, 2019

Author Contributor

Implementation follows the existing pattern established by Accept-Encoding.


override def entry: Rule1[Link] = rule {
"<" ~ super[UriHeaderParser].entry ~ ">" ~ zeroOrMore(";" ~ OptWS ~ LinkAttr)
def LinkValue: Rule1[LinkValue] = rule {

This comment has been minimized.

Copy link
@bfdes

bfdes Nov 6, 2019

Author Contributor

Taken from UriHeaderParser (along with the charset member). Tried extending UriHeaderParser instead of the base trait Http4sHeaderParser, but I had some compile issues -- possibly due to the order in which traits were implemented.

This comment has been minimized.

Copy link
@rossabaker

rossabaker Nov 14, 2019

Member

Yeah, those traits are a mess. parboiled2 rules don't compose well, and we haven't holistically refactored the mess we've made.

@bfdes

This comment has been minimized.

Copy link
Contributor Author

bfdes commented Nov 6, 2019

This particular job is failing, and I'm not sure why.

@hamnis
hamnis approved these changes Nov 13, 2019
Copy link
Contributor

hamnis left a comment

LGTM

Copy link
Member

rossabaker left a comment

The build failure mentioned above was a Travis CI flake. The other build failure is the cursed blaze-client Travis CI flake.

Thanks for the fix!


override def entry: Rule1[Link] = rule {
"<" ~ super[UriHeaderParser].entry ~ ">" ~ zeroOrMore(";" ~ OptWS ~ LinkAttr)
def LinkValue: Rule1[LinkValue] = rule {

This comment has been minimized.

Copy link
@rossabaker

rossabaker Nov 14, 2019

Member

Yeah, those traits are a mess. parboiled2 rules don't compose well, and we haven't holistically refactored the mess we've made.

@rossabaker rossabaker merged commit 9a12d12 into http4s:master Nov 26, 2019
1 of 2 checks passed
1 of 2 checks passed
continuous-integration/travis-ci/pr The Travis CI build failed
Details
Summary no rules match, no planned actions
Details
@bfdes bfdes deleted the bfdes:http4s-2852 branch 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.