summaryrefslogtreecommitdiff
path: root/lib/api/helpers
diff options
context:
space:
mode:
authorAhmet Demir <ahmet2mir+gitlab@gmail.com>2018-06-28 06:10:51 +0000
committerAchilleas Pipinellis <axil@gitlab.com>2018-06-28 06:10:51 +0000
commit80f4e7575e99c4dfe1cf7a6ccf1b055e7654be4b (patch)
treec28f6e7a6f174980e77a61ece8f60a74634f0020 /lib/api/helpers
parenta17d0527bed2117e2998312ad749477712827681 (diff)
downloadgitlab-ce-80f4e7575e99c4dfe1cf7a6ccf1b055e7654be4b.tar.gz
Add SHA256 and HEAD on File API
Diffstat (limited to 'lib/api/helpers')
-rw-r--r--lib/api/helpers/headers_helpers.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/api/helpers/headers_helpers.rb b/lib/api/helpers/headers_helpers.rb
new file mode 100644
index 00000000000..cde51fccc62
--- /dev/null
+++ b/lib/api/helpers/headers_helpers.rb
@@ -0,0 +1,11 @@
+module API
+ module Helpers
+ 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
+ end
+ end
+ end
+ end
+end