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

WithAddServerUrls Option with protocol parameter #2

Open
2 tasks
fabiante opened this issue Jul 5, 2023 · 1 comment
Open
2 tasks

WithAddServerUrls Option with protocol parameter #2

fabiante opened this issue Jul 5, 2023 · 1 comment

Comments

@fabiante
Copy link
Member

fabiante commented Jul 5, 2023

WithAddServerUrls implicitly adds two server urls, one for http, one for https.

func WithAddServerUrls() Option {

  • It would be nice to make this more flexibel by allowing explicit control over the protocol.
  • While doing so, let's rename WithAddServerUrls to WithDynamicServerUrl

In Summary, let's change the method signature to:

func WithDynamicServerUrl(secure bool) Option

I think the new name states more clearly what this function does.

@fabiante
Copy link
Member Author

fabiante commented Jul 5, 2023

I am unsure about how the parameter should work and if we want to call WithDynamicServerUrl twice then, once for HTTP, once for HTTP.

There may also be the option to support proxies which often include the original protocol as header. This would allow to correctly determine the protocol even if the application is behind a reverse proxy which terminates SSL and forwards without SSL.

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

1 participant