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

Fix Method.fromString #3716

Merged
merged 1 commit into from Oct 4, 2020
Merged

Conversation

satorg
Copy link
Contributor

@satorg satorg commented Sep 29, 2020

Should resolve #3680
Fixes the Rfc2616BasicRules.token method which is used in Method.fromString.
The Rfc2616BasicRules.isToken method should also get fixed.

Copy link
Member

@rossabaker rossabaker left a comment

Looks great.

@@ -26,10 +29,33 @@ class MethodSpec extends Http4sSpec {

"only tokens are valid methods" in {
prop { (s: String) =>
// TODO: this check looks meaningless: `fromString` mostly relies on `Rfc2616BasicRules.token`
// and the result is compared to `isToken` which calls to `Rfc2616BasicRules.token` as well.
Copy link
Member

@rossabaker rossabaker Oct 4, 2020

Choose a reason for hiding this comment

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

Yeah, it's difficult to avoid repeating implementation in some property tests. These kind of properties guard against future optimizations that break the contract, but that's unlikely here.

@rossabaker rossabaker merged commit f1c0ff5 into http4s:series/0.21 Oct 4, 2020
@satorg satorg deleted the fix-method-as-token branch Oct 4, 2020
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

2 participants