Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Create CaseSensitiveString to preserve case in header name
Browse files Browse the repository at this point in the history
Create CaseSensitiveString (override the downcase and capitalize method to return self) and use it in the Http Request header to preserve the case in header name.
This is a workaround that Ruby library converts the header name (http://stackoverflow.com/questions/10258893/stop-ruby-http-request-modifying-header-name) while the OMS workflow is case sensitive.
  • Loading branch information
robbiezhang committed Apr 11, 2016
1 parent 88ac2a6 commit 67deffb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions source/code/plugins/oms_common.rb
Original file line number Diff line number Diff line change
Expand Up @@ -729,4 +729,13 @@ def refresh_cache

end

class CaseSensitiveString < String
def downcase
self
end
def capitalize
self
end
end

end # module OMS
2 changes: 1 addition & 1 deletion source/code/plugins/out_oms_blob.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def create_blob_get_request(uri)
def create_blob_put_request(uri, msg)
headers = {}

headers["x-ms-meta-timezoneid"] = OMS::Common.get_current_timezone
headers[OMS::CaseSensitiveString.new("x-ms-meta-timezoneid")] = OMS::Common.get_current_timezone
headers["Content-Type"] = "application/octet-stream"
headers["Content-Length"] = msg.bytesize.to_s

Expand Down

0 comments on commit 67deffb

Please sign in to comment.