Skip to content

Commit

Permalink
IV-3008 move setting of headers outside of begin block.
Browse files Browse the repository at this point in the history
  • Loading branch information
Lopaka Delp committed Sep 22, 2015
1 parent e806390 commit 5be6769
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lib/right_api_client/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -483,12 +483,11 @@ def do_put(path, params={})

req, res, resource_type, body = nil

# Altering headers to set Content-Type to text/plain when updating rightscript content
put_headers = path =~ %r(^/api/right_scripts/.+/source$) ? headers.merge('Content-Type' => 'text/plain') : headers

begin
retry_request do
# Altering headers to set Content-Type to text/plain when updating rightscript content
put_headers =
path =~ %r(^/api/right_scripts/.+/source$) ? headers.merge('Content-Type' => 'text/plain') : headers

@rest_client[path].put(params, put_headers) do |response, request, result|
req, res = request, response
update_cookies(response)
Expand Down

0 comments on commit 5be6769

Please sign in to comment.