mozilla / PyFxA

Python library for interacting with the Firefox Accounts ecosystem
Other
31 stars 20 forks source link

oauth.Client.get_redirect_url sometimes returning double slash in URL #73

Closed pmac closed 5 years ago

pmac commented 5 years ago

I haven't yet been able to track down the exact circumstances but we ran into this issue in basket. Sometimes the URL returned by the get_redirect_url() method would look like https://oauth.stage.mozaws.net/v1//authorization?scope=profile... and this would result in a 404 response. Seems to happen regardless of the server_url value. I was using the values for server_url straight from the constants.py file for the oauth key. I'll update this if I figure anything else out. My solution for now is to build the URL myself in the basket code.

pmac commented 5 years ago

All I can guess is that something in the urlparse and then urlunparse steps is causing the extra slash to pop up. I don't see a reason it's necessary to parse the URL anyway since it's really just server + path + query params.

rfk commented 5 years ago

Looks like the low-level request-making helper was unwisely modifying self.server_url in-place; please take a look at https://github.com/mozilla/PyFxA/pull/74 which I suspect will fix the issue.

rfk commented 5 years ago

I cut a v0.7.2 release with the fix included.