Closed Harper04 closed 3 years ago
The particular example that you provided could be achieved by simply setting not setting the option. Or do you have something slightly more complex?
In any case, this can be a breaking change if someone is passing the :host
atom as an option today. The only way I can see support this is by adding a new redirect_unsafe_to
option and deprecate the host one.
Oh did not know that! Phoenix sets the host by default according to its endpoint definition.
With that in mind the only use cases i see are
1) keep using the force_ssl option in phoenix possible. But maybe host: nil would suffice too cause phoenix is using put_new
2) having one redirect less from https://www.example.com to https://example.com
I think 2 does not justify a change like that. Thank you!
Hi,
i came across this use case for the third time now and decided to make a pull request. The host callback (
{MODULE, :func, []}
is not able to get the host of the request. Therefore i cant redirect http://example.com to http://example.com while redirecting http://example.de to https://example.de.I figured a way could be to just replace the first argument if i specify
:host
while preserving existing behavior.Usage is