mirror of
https://github.com/wahyd4/gitlabhq.git
synced 2026-08-13 14:46:05 +10:00
Only enable HSTS header for HTTPS and port 443
Closes https://github.com/gitlabhq/gitlabhq/issues/9449
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
Please view this file on the master branch, on stable branches it's out of date.
|
||||
|
||||
v 7.13.0 (unreleased)
|
||||
- Only enable HSTS header for HTTPS and port 443 (Stan Hu)
|
||||
- Fix user autocomplete for unauthenticated users accessing public projects (Stan Hu)
|
||||
- Fix redirection to home page URL for unauthorized users (Daniel Gerhardt)
|
||||
- Add branch switching support for graphs (Daniel Gerhardt)
|
||||
|
||||
@@ -183,7 +183,10 @@ class ApplicationController < ActionController::Base
|
||||
headers['X-XSS-Protection'] = '1; mode=block'
|
||||
headers['X-UA-Compatible'] = 'IE=edge'
|
||||
headers['X-Content-Type-Options'] = 'nosniff'
|
||||
headers['Strict-Transport-Security'] = 'max-age=31536000' if Gitlab.config.gitlab.https
|
||||
# Enabling HSTS for non-standard ports would send clients to the wrong port
|
||||
if Gitlab.config.gitlab.https and Gitlab.config.gitlab.port == 443
|
||||
headers['Strict-Transport-Security'] = 'max-age=31536000'
|
||||
end
|
||||
end
|
||||
|
||||
def add_gon_variables
|
||||
|
||||
Reference in New Issue
Block a user