diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-12-19 14:01:45 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-12-19 14:01:45 +0300 |
commit | 9297025d0b7ddf095eb618dfaaab2ff8f2018d8b (patch) | |
tree | 865198c01d1824a9b098127baa3ab980c9cd2c06 /spec/requests/jwks_controller_spec.rb | |
parent | 6372471f43ee03c05a7c1f8b0c6ac6b8a7431dbe (diff) |
Add latest changes from gitlab-org/gitlab@16-7-stable-eev16.7.0-rc42
Diffstat (limited to 'spec/requests/jwks_controller_spec.rb')
-rw-r--r-- | spec/requests/jwks_controller_spec.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/spec/requests/jwks_controller_spec.rb b/spec/requests/jwks_controller_spec.rb index f756c1758e4..3dc3ed68311 100644 --- a/spec/requests/jwks_controller_spec.rb +++ b/spec/requests/jwks_controller_spec.rb @@ -55,5 +55,26 @@ RSpec.describe JwksController, feature_category: :system_access do end end end + + it 'has cache control header' do + get jwks_url + + expect(response).to have_gitlab_http_status(:ok) + expect(response.headers['Cache-Control']).to include('max-age=86400', 'public', 'must-revalidate', 'no-transform') + end + + context 'when cache_control_headers_for_openid_jwks feature flag is disabled' do + before do + stub_feature_flags(cache_control_headers_for_openid_jwks: false) + end + + it 'does not have cache control header' do + get jwks_url + + expect(response).to have_gitlab_http_status(:ok) + expect(response.headers['Cache-Control']).not_to include('max-age=86400', 'public', + 'no-transform') + end + end end end |