diff options
author | Robert Speicher <robert@gitlab.com> | 2017-05-23 18:49:44 +0000 |
---|---|---|
committer | Timothy Andrew <mail@timothyandrew.net> | 2017-05-31 03:57:25 +0000 |
commit | 88d0ccd551f0334304de665ece94ba9810c60de7 (patch) | |
tree | ca2f8b129c6d370698544a070f9dea8c407bc087 | |
parent | 664ee81486a3205675cfadf3c98f9654d256f538 (diff) | |
download | gitlab-ce-88d0ccd551f0334304de665ece94ba9810c60de7.tar.gz |
Merge branch 'dz-api-x-frame' into 'security-9-2'
Restrict API X-Frame-Options to same origin
See merge request !2103
-rw-r--r-- | changelogs/unreleased/dz-api-x-frame.yml | 4 | ||||
-rw-r--r-- | lib/api/api.rb | 1 |
2 files changed, 5 insertions, 0 deletions
diff --git a/changelogs/unreleased/dz-api-x-frame.yml b/changelogs/unreleased/dz-api-x-frame.yml new file mode 100644 index 00000000000..0483a9e076a --- /dev/null +++ b/changelogs/unreleased/dz-api-x-frame.yml @@ -0,0 +1,4 @@ +--- +title: Restrict API X-Frame-Options to same origin +merge_request: +author: diff --git a/lib/api/api.rb b/lib/api/api.rb index 52cd7cbe3db..6f5f4283937 100644 --- a/lib/api/api.rb +++ b/lib/api/api.rb @@ -45,6 +45,7 @@ module API end before { allow_access_with_scope :api } + before { header['X-Frame-Options'] = 'SAMEORIGIN' } before { Gitlab::I18n.set_locale(current_user) } after { Gitlab::I18n.reset_locale } |