diff options
author | Francisco Javier López 🌴 On vacation; back on August 22th! <fjlopez@gitlab.com> | 2018-08-01 19:48:33 +0300 |
---|---|---|
committer | Nick Thomas <nick@gitlab.com> | 2018-08-01 19:48:33 +0300 |
commit | 4b36f74bfedc854b8628f2597223f17ea19e3abd (patch) | |
tree | a06e901f8f95104d33127fcf77064aa804073d3b /lib/api | |
parent | dae5c2665df3dd3b33a04ff215f39ef6a336d1da (diff) |
Fix bug setting http headers in Files API
Diffstat (limited to 'lib/api')
-rw-r--r-- | lib/api/helpers/headers_helpers.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/api/helpers/headers_helpers.rb b/lib/api/helpers/headers_helpers.rb index cde51fccc62..c9c44e3c218 100644 --- a/lib/api/helpers/headers_helpers.rb +++ b/lib/api/helpers/headers_helpers.rb @@ -3,7 +3,11 @@ module API module HeadersHelpers def set_http_headers(header_data) header_data.each do |key, value| - header "X-Gitlab-#{key.to_s.split('_').collect(&:capitalize).join('-')}", value + if value.is_a?(Enumerable) + raise ArgumentError.new("Header value should be a string") + end + + header "X-Gitlab-#{key.to_s.split('_').collect(&:capitalize).join('-')}", value.to_s end end end |