gitlab-org--gitlab-foss/lib/api/helpers/headers_helpers.rb

18 lines
424 B
Ruby
Raw Normal View History

# frozen_string_literal: true
2018-06-28 02:10:51 -04:00
module API
module Helpers
module HeadersHelpers
def set_http_headers(header_data)
header_data.each do |key, 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
2018-06-28 02:10:51 -04:00
end
end
end
end
end