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

Tests for IsRequestURI and IsRequestURL fail #118

Closed
NightTsarina opened this issue Mar 26, 2016 · 1 comment
Closed

Tests for IsRequestURI and IsRequestURL fail #118

NightTsarina opened this issue Mar 26, 2016 · 1 comment

Comments

@NightTsarina
Copy link

Hi,

The tests for govalidator are failing with go 1.6:

--- FAIL: TestIsRequestURL (0.00s)
    validator_test.go:684: Expected IsRequestURL("http://foo.bar#com") to be true, got false
    validator_test.go:684: Expected IsRequestURL("http://foobar.com#baz=qux") to be true, got false


--- FAIL: TestIsRequestURI (0.00s)
    validator_test.go:733: Expected IsRequestURI("http://foo.bar#com") to be true, got false
    validator_test.go:733: Expected IsRequestURI("http://foobar.com#baz=qux") to be true, got false

Looking at the source code, I see that this uses ParseRequestURI from net/url, which states in the documentation:

The string rawurl is assumed not to have a #fragment suffix. (Web browsers strip #fragment before sending the URL to a web server.)

So, I believe these URLs should not validate.

annismckenzie pushed a commit to annismckenzie/govalidator that referenced this issue Apr 11, 2016
annismckenzie added a commit to annismckenzie/govalidator that referenced this issue Apr 12, 2016
annismckenzie added a commit to annismckenzie/govalidator that referenced this issue May 3, 2016
annismckenzie added a commit to annismckenzie/govalidator that referenced this issue May 17, 2016
@asaskevich
Copy link
Owner

Fixed in #123

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

No branches or pull requests

2 participants