Skip to content

assertRedirects assume HTTP is always the used protocol #142

@rafspiny

Description

@rafspiny

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions