Skip to content

[Validator] Allow an empty path in a URL with only a fragment or a query #16259

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

Merged
merged 1 commit into from
Oct 17, 2015

Conversation

jakzal
Copy link
Contributor

@jakzal jakzal commented Oct 16, 2015

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #15891
License MIT
Doc PR -

URLs like http://symfony.com?query=1 or http://symfony.com# should be valid.

According to the RFC3986:

When authority is present, the path must either be empty or begin with a slash ("/") character.
When authority is not present, the path cannot begin with two slash characters ("//").

Since the RFC describes URIs, the second sentence doesn't apply here as the authority is required in URLs .

@Tobion
Copy link
Contributor

Tobion commented Oct 16, 2015

👍

Status: Reviewed

@fabpot
Copy link
Member

fabpot commented Oct 17, 2015

Thank you @jakzal.

@fabpot fabpot merged commit b3a5411 into symfony:2.3 Oct 17, 2015
fabpot added a commit that referenced this pull request Oct 17, 2015
…ent or a query (jakzal)

This PR was merged into the 2.3 branch.

Discussion
----------

[Validator] Allow an empty path in a URL with only a fragment or a query

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #15891
| License       | MIT
| Doc PR        | -

URLs like `http://symfony.com?query=1` or `http://symfony.com#` should be valid.

According to the [RFC3986](https://tools.ietf.org/html/rfc3986#page-16):

> When authority is present, the path must either be empty or begin with a slash ("/") character.
> When authority is not present, the path cannot begin with two slash characters ("//").

Since the RFC describes URIs, the second sentence doesn't apply here as the authority is required in URLs .

Commits
-------

b3a5411 [Validator] Allow an empty path in a URL with only a fragment or a query
@jakzal jakzal deleted the validator/empty-path branch October 26, 2015 11:30
This was referenced Oct 27, 2015
@zorji
Copy link

zorji commented Nov 13, 2015

@jakzal Can you double check your changes?
The following 2 test cases passed

But this test case failed

fabpot added a commit that referenced this pull request Nov 13, 2015
…or a query (jakzal)

This PR was merged into the 2.3 branch.

Discussion
----------

[Validator] Allow an empty path with a non empty fragment or a query

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #16536
| License       | MIT
| Doc PR        | -

#16259 didn't fully fix the issue.

Commits
-------

2d0af8e [Validator] Allow an empty path with a non empty fragment or a query
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants