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

get_self_url_host can generate broken hostnames #304

Open
lvanderree opened this issue Mar 22, 2023 · 1 comment
Open

get_self_url_host can generate broken hostnames #304

lvanderree opened this issue Mar 22, 2023 · 1 comment

Comments

@lvanderree
Copy link

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

@pitbulk
Copy link
Contributor

pitbulk commented May 15, 2023

@lvanderree Do you have a PR?

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

2 participants