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

Redirect & Duplicate Query String Parameters #157

Open
nadersoliman opened this issue May 31, 2014 · 1 comment
Open

Redirect & Duplicate Query String Parameters #157

nadersoliman opened this issue May 31, 2014 · 1 comment
Labels
Milestone

Comments

@nadersoliman
Copy link

Hello,

In case of 30X redirect on a GET, httplib2 calls back on oauth2 client.request with new location, and body filled with oauth tokens. oauth2 client.request then generates new oauth tokens and appends the body causing a duplicate oauth tokens in the request.

In httplibe2/init.py:1385

                        (response, content) = self.request(
                            location, method=redirect_method,
                            body=body, headers=headers,
                            redirections=redirections - 1)

This call back to oauth2.Client.request will sign a url that already contains oauth signature parts, and append them to the url causing duplicate oauth signature. This causes troubles to some backends, in my case it was odesk backend.

As per RFC2616[1], Location header on a redirect contains an absolute uri not a base uri.
As per RFC3986[2], absolute uri can contain query string parameters

[1]
http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.30
[2]
http://tools.ietf.org/html/rfc3986#page-27

@jaitaiwan jaitaiwan added the Bug label Jul 29, 2015
@jaitaiwan
Copy link
Contributor

Thanks for reporting this @nadersoliman

@jaitaiwan jaitaiwan added this to the 2.0 milestone Jul 29, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants