-
-
Notifications
You must be signed in to change notification settings - Fork 752
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Omit standard protocol ports from the default hostname #1543
Conversation
Thank you for the pull request! What do you think about checking for |
@daffl I questioned that, too. There are myriads of configurations. Even in dev environments, it isn't that uncommon to have a dockerized environment behind an nginx running HTTPS (https://github.com/jwilder/nginx-proxy is a good one). Perhaps a better way to handle this would be to not add the port at all, and assume that it is included in the |
The reason I was suggesting based on the environment is that I would like to cover the following two cases without having to configure anything:
For everything else it's always possible to customize the port and hostname oauth settings. |
Okay, let's game this out:
Do you care about 3-6 being wrong by default, thus needing special configuration? If so, then we need to change the assumption of https in production/http everywhere else. |
I think that's ok especially since all it takes is a configuration setting. 5. and 6. should definitely be discouraged and 3. and 4. is not covered by the standard environment that's generated by the Feathers CLI. |
Does that make sense? Let me know if you are interested in updating the PR. Definitely agree that this should be improved. |
@daffl since you don't care about 3-6, nothing needs to be changed on this PR. It will fulfill the behaviors listed in 1-2 and 7-8 by default. Am I missing something? |
The idea is to make sure the following are true (based on this PR and on some previous issues/discussions) :
For everything else, user's would configure a custom I think your PR just needs the following change: -if ((protocol === 'https' && port !== '443') || (protocol === 'http' && port !== '80'))
+if (env !== 'production' && ((protocol === 'https' && port !== '443') || (protocol === 'http' && port !== '80'))) and ideally tests to go over the different permutations to we avoid future regressions. |
On a related, but slightly different topic, wondering how often Feathers checks for |
Thanks for that clarification and suggestion. This version should accomplish all our goals and is much easier to read to boot. |
This looks good to me, just will need to see what @daffl thinks about the use of 'development' – it depends a bit on what Feathers uses elsewhere for consistency. Though it looks like it's using a bit of both. Wondering, for example, if we should do |
Oh you're right, I didn't pay attention, sorry about that. Good to go then, thank you! |
When running on the standard port for the protocol (80 for http, 443 for https), the default oauth
redirect_uri
contains the port, which is redundant and causes the authentication request to fail in most cases.