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

assertRedirects assume HTTP is always the used protocol #142

Open
rafspiny opened this issue Dec 19, 2019 · 0 comments
Open

assertRedirects assume HTTP is always the used protocol #142

rafspiny opened this issue Dec 19, 2019 · 0 comments

Comments

@rafspiny
Copy link

The function in object assume HTTP is the only scheme.
If the PREFERRED_URL_SCHEME has been set to HTTPS it will not pick up the changes, resulting in false positives during testing.

It is true that you can pass an absolute URL, bypassing the problem. Nevertheless, I am wondering if it would be better to have this function to comply with the PREFERRED_URL_SCHEME specified in Flask.

Code here

Suggested change:

expected_location = urljoin("%s://%s" % (self.app.config.get('PREFERRED_URL_SCHEME'), server_name), location)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant