Skip to content

get_self_url_host can generate broken hostnames #304

Description

@lvanderree

When running a (Django) application in a (docker) container, chances are there that you are exposing your application on a different port than the application is running.

in that case current_host includes the port from the request (exposed via the container), while port_suffix is the internally known port (from the app). In that case you can get for example "saml_sp_host:1080:8000"

this is the result of:

onelogin/saml2/utils.py:267

            if not current_host.endswith(port_suffix):
                if not ((protocol == 'https' and port_suffix == ':443') or (protocol == 'http' and port_suffix == ':80')):
                    current_host += port_suffix

maybe it is better to explode on : in the current_host, instead of checking the end of the string

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions