-
Notifications
You must be signed in to change notification settings - Fork 7
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
Issue 51904: Strict-Transport-Security header when HTTPS is required #6168
Issue 51904: Strict-Transport-Security header when HTTPS is required #6168
Conversation
@labkey-adam @labkey-matthewb no need to rush to adopt this but it was easy so I figured I'd open the PR before the holidays |
@@ -164,6 +165,11 @@ public void doFilter(ServletRequest request, ServletResponse response, FilterCha | |||
return; | |||
} | |||
|
|||
if (sslRequired) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider adding a devMode check. I believe the reason we don't already have this is because it is incredibly sticky. If you do this on a dev machine and test SSL, you won't be able to use http: until next year or until you figure out how to make your browser forget this setting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ask me how I know...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good idea. Update pushed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we set the header even if the current request is http? (along with the redirect?)
We could, but I saw commentary that it's only supposed to be set for HTTPS responses. Apparently browsers ignore it for plain HTTP |
That makes sense actually. |
Rationale
We have many protections in place already to ensure that traffic is always over HTTPS. We can set this header to catch an edge case for an initial http:// request on a third-party link.
Changes
Strict-Transport-Security
header when the server is already requiring HTTPS connections