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

Don't encode the url twice when following a redirect #615

Merged
merged 2 commits into from Jul 30, 2012

Conversation

nremond
Copy link
Contributor

@nremond nremond commented Jul 27, 2012

If a run a simulation where I have http.rawUrl=false and followRedirect=true, when I get this reponse from the server

Response DefaultHttpResponse(chunked: false)
HTTP/1.0 302 Found
Location: http://access.secutix.com/wrcontroller1/selectqueue.do?queue=q-LDT&source=https%3a%2f%2fone.secutix.com%2ftnsa10%2flive%2fshop%2fLDT%2fINTERNET%2fts%2fevent%2findex.php
Cache-Control: no-cache
Pragma: no-cache
Expires: Mon, 26 Jul 1997 05:00:00 GMT
Retry-After: 1
Server: BigIP
Connection: Keep-Alive
Content-Length: 0

Galting is then sending the following request :

11:30:53.748 [DEBUG] c.n.h.c.p.n.NettyConnectionsPool - Adding uri: https://one.secutix.com:443 for channel [id: 0x4fbc79fa, /10.10.176.49:43533 => one.secutix.com/193.73.238.153:443]
11:30:53.813 [DEBUG] c.n.h.c.p.n.NettyAsyncHttpProvider - 
Non cached request 
DefaultHttpRequest(chunked: false)
GET /wrcontroller1/selectqueue.do?queue=q-LDT&source=https%253a%252f%252fone.secutix.com%252ftnsa10%252flive%252fshop%252fLDT%252fINTERNET%252fts%252fevent%252findex.php HTTP/1.1
Host: access.secutix.com
Accept: image/png,image/*;q=0.8,*/*;q=0.5
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip
Connection: keep-alive
User-Agent: NING/1.0

The URL is encoded twice ...

@slandelle
Copy link
Member

Hi Nico,

IMHO, it would be better to have all the logic of computing redirect urls inside HttpHelper.computeRedirectUrl instead of scattering it like you did.
Also, could it be possible to add some tests to show what you fixed exactly, please? Not that I don't trust you, but I have to admit AHC useRawUrl parameter doesn't feel very clear to me...

Steph

@nremond
Copy link
Contributor Author

nremond commented Jul 30, 2012

I think I found the root cause of my troubles ... but I haven't been able to write an associated test case :-S

slandelle pushed a commit that referenced this pull request Jul 30, 2012
Don't encode twice the url when following a redirect
@slandelle slandelle merged commit 884d75c into gatling:master Jul 30, 2012
@ghost ghost assigned nremond Jul 30, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

2 participants