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

make allowed hosts backward compatible checking user config #45

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

davidjr82
Copy link
Contributor

Hi,

I have seen version 1.5.1 trying to make the allowed_hosts backwards compatible. Unfortunately, this change does not work, because the config('login-link.allowed_hosts') will merge the user configuration and the package configuration, so if the user does not have the configuration set, this helper will return the package configuration making this check useless.

I have added a private method to get the user configuration first, and if it is not set, then it will not throw the exception, keeping the original idea of making it backwards compatible, although I still think it is a bad idea and it would be better to throw the exception.

I have also added 127.0.0.1 to the default list of allowed hosts.

I haven't added tests because I don't know how to fake the user configuration and the package configuration separately. I noticed the problem while checking your PR in my local environment.

@davidjr82 davidjr82 changed the title make allowed hosts backward compatible checking local config make allowed hosts backward compatible checking user config Dec 20, 2024
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

Successfully merging this pull request may close these issues.

1 participant