diff options
author | Adam Niedzielski <adamsunday@gmail.com> | 2017-04-05 15:35:05 +0200 |
---|---|---|
committer | Adam Niedzielski <adamsunday@gmail.com> | 2017-04-05 15:35:05 +0200 |
commit | 35bafb3797505f576934203fa29340239f26a80c (patch) | |
tree | 43d822e5456a5de9b9c22c975fc4e30800722246 | |
parent | d4349ba6c4960f50dce7b0beec5f309894dbada9 (diff) | |
download | gitlab-ce-convert-poll-interval-to-string.tar.gz |
Convert value to string before setting Poll-Interval headerconvert-poll-interval-to-string
-rw-r--r-- | lib/gitlab/polling_interval.rb | 2 | ||||
-rw-r--r-- | spec/lib/gitlab/polling_interval_spec.rb | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/gitlab/polling_interval.rb b/lib/gitlab/polling_interval.rb index c44bb1cd14d..f0c50584f07 100644 --- a/lib/gitlab/polling_interval.rb +++ b/lib/gitlab/polling_interval.rb @@ -12,7 +12,7 @@ module Gitlab value = -1 end - response.headers[HEADER_NAME] = value + response.headers[HEADER_NAME] = value.to_s end def self.polling_enabled? diff --git a/spec/lib/gitlab/polling_interval_spec.rb b/spec/lib/gitlab/polling_interval_spec.rb index 56c2847e26a..5ea8ecb1c30 100644 --- a/spec/lib/gitlab/polling_interval_spec.rb +++ b/spec/lib/gitlab/polling_interval_spec.rb @@ -15,7 +15,7 @@ describe Gitlab::PollingInterval, lib: true do it 'sets value to -1' do polling_interval.set_header(response, interval: 10_000) - expect(headers['Poll-Interval']).to eq(-1) + expect(headers['Poll-Interval']).to eq('-1') end end @@ -27,7 +27,7 @@ describe Gitlab::PollingInterval, lib: true do it 'applies modifier to base interval' do polling_interval.set_header(response, interval: 10_000) - expect(headers['Poll-Interval']).to eq(3333) + expect(headers['Poll-Interval']).to eq('3333') end end end |