diff options
author | Cindy Pallares <cindy@gitlab.com> | 2018-11-28 18:38:00 +0000 |
---|---|---|
committer | Cindy Pallares <cindy@gitlab.com> | 2018-11-28 19:08:32 -0500 |
commit | 94ab2d5fc80d71df5637e6bbe1f5272daf6aa38c (patch) | |
tree | e044ce2a16e90cc64373601be7345b259aa19815 /spec/support/helpers/prometheus_helpers.rb | |
parent | 4bc6f2e3ac8e6997ebc3b06867049dc38aa6d6e6 (diff) | |
download | gitlab-ce-94ab2d5fc80d71df5637e6bbe1f5272daf6aa38c.tar.gz |
Merge branch 'security-2736-prometheus-ssrf' into 'master'
[master] Do not follow redirects in prometheus service
See merge request gitlab/gitlabhq!2617
Diffstat (limited to 'spec/support/helpers/prometheus_helpers.rb')
-rw-r--r-- | spec/support/helpers/prometheus_helpers.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/spec/support/helpers/prometheus_helpers.rb b/spec/support/helpers/prometheus_helpers.rb index 4212be2cc88..ce1f9fce10d 100644 --- a/spec/support/helpers/prometheus_helpers.rb +++ b/spec/support/helpers/prometheus_helpers.rb @@ -49,11 +49,11 @@ module PrometheusHelpers "https://prometheus.example.com/api/v1/series?#{query}" end - def stub_prometheus_request(url, body: {}, status: 200) + def stub_prometheus_request(url, body: {}, status: 200, headers: {}) WebMock.stub_request(:get, url) .to_return({ status: status, - headers: { 'Content-Type' => 'application/json' }, + headers: { 'Content-Type' => 'application/json' }.merge(headers), body: body.to_json }) end |