Commit f3c1aca4 authored by Mayra Cabrera's avatar Mayra Cabrera

Merge branch 'sh-fix-cfray-log' into 'master'

Fix Cf-Ray HTTP header not being logged

See merge request gitlab-org/gitlab!31983
parents eb0bb14b 7ad4803e
......@@ -14,7 +14,7 @@ module Gitlab
def valid_cloudflare_header?(value)
return false unless value.present?
return false if value.length > 64
return false if value.index(/[^[:alnum:]]/)
return false if value.index(/[^[A-Za-z0-9-]]/)
true
end
......
......@@ -19,7 +19,7 @@ describe Gitlab::Logging::CloudflareHelper do
end
context 'with normal headers' do
let(:headers) { { 'Cf-Ray' => SecureRandom.hex, 'Cf-Request-Id' => SecureRandom.hex } }
let(:headers) { { 'Cf-Ray' => '592f0aa22b3dea38-IAD', 'Cf-Request-Id' => SecureRandom.hex } }
it 'adds Cf-Ray-Id and Cf-Request-Id' do
helper.store_cloudflare_headers!(payload, request)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment