diff options
Diffstat (limited to 'lib')
-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 |