Skip to content
This repository has been archived by the owner on Dec 14, 2018. It is now read-only.

RequireHttpsAttribute doesn't change the port #4112

Closed
Tratcher opened this issue Feb 18, 2016 · 2 comments
Closed

RequireHttpsAttribute doesn't change the port #4112

Tratcher opened this issue Feb 18, 2016 · 2 comments
Assignees
Milestone

Comments

@Tratcher
Copy link
Member

RequireHttpsAttribute changes the scheme but not the port, so http://localhost:44380/ gets redirected to https://localhost:44380/, which is invalid because you can't serve both http and https on the same port.

The only way this ever worked was if the original request's host header did not include the port (e.g. localhost rather than localhost:80)

There's even a (wrong) test:
25838ce#diff-ba666c0ff94ddf047b6f11caa0ac94c9R42

@sebastienros @blowdart @javiercn

@Tratcher Tratcher added the bug label Feb 18, 2016
@Tratcher Tratcher added this to the 1.0.0-rc2 milestone Feb 18, 2016
@Eilon
Copy link
Member

Eilon commented Feb 18, 2016

Kind of related to #4093

In the default case we should indeed drop the port number when redirecting to HTTPS, and fix the offending test.

sebastienros added a commit that referenced this issue Feb 18, 2016
New optional MvcOptions.SslPort. If not defined the redirection uses an empty port (default),
otherwise the custom port is used.
sebastienros added a commit that referenced this issue Feb 18, 2016
New optional MvcOptions.SslPort. If not defined the redirection uses an empty port (default),
otherwise the custom port is used.
sebastienros added a commit that referenced this issue Feb 19, 2016
New optional MvcOptions.SslPort. If not defined the redirection uses an empty port (default),
otherwise the custom port is used.
sebastienros added a commit that referenced this issue Feb 20, 2016
New optional MvcOptions.SslPort. If not defined the redirection uses an empty port (default),
otherwise the custom port is used.
sebastienros added a commit that referenced this issue Feb 22, 2016
New optional MvcOptions.SslPort. If not defined the redirection uses an empty port (default),
otherwise the custom port is used.
sebastienros added a commit that referenced this issue Feb 23, 2016
New optional MvcOptions.SslPort. If not defined the redirection uses an empty port (default),
otherwise the custom port is used.
@Eilon
Copy link
Member

Eilon commented Feb 23, 2016

3-Done?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants