8000 [BrowserKit] getAbsoluteUri() not working as expected with values that only contain query string parameters (eg. ?foo=bar) · Issue #19303 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[BrowserKit] getAbsoluteUri() not working as expected with values that only contain query string parameters (eg. ?foo=bar) #19303

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

Closed
georaldc opened this issue Jul 6, 2016 · 2 comments

Comments

@georaldc
Copy link
Contributor
georaldc commented Jul 6, 2016

Similar to URIs just containing hash values, I believe the result from getAbsoluteUri() should still re-use an existing, previous request when working with only a query string value. This actually gave me problems using a related project (goutte) where a redirect to a location containing only query string parameters was sending goutte to the wrong location.

I can create a PR if this is an actual issue.

@xabbuh
Copy link
Member
xabbuh commented Jul 7, 2016

Imo that's an issue of the server's response. Afaik a Location header must contain a full URL and not only URL parameters.

@georaldc
Copy link
Contributor Author
georaldc commented Jul 7, 2016

I'm not familiar with the rules but browsers handle this just fine. Another library I noticed that seems to handle it fine too is guzzle

fabpot added a commit that referenced this issue Jul 10, 2016
…ing only URIs (georaldc)

This PR was merged into the 2.7 branch.

Discussion
----------

[BrowserKit] Update Client::getAbsoluteUri() for query string only URIs

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

This PR allows BrowserKit to treat a value containing only query string parameters the same way anchor/hash values are treated when passed as a URI argument to the getAbsoluteUri() method. Helps when encountering sites that force a redirect with a location header value containing only a query string.

Commits
-------

965408f Update getAbsoluteUri() for query string uris
@fabpot fabpot closed this as completed Jul 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants
0