Skip to content

Commit

Permalink
Merge pull request #206 from thomasmckay/24370-no-log-binary
Browse files Browse the repository at this point in the history
fixes #24370 - don't log binary upload contents
  • Loading branch information
beav authored Aug 14, 2018
2 parents d60ac3f + b20500a commit c4ec673
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion lib/runcible/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ def path(*args)
end

# rubocop:disable Metrics/AbcSize:
# rubocop:disable PerceivedComplexity
def call(method, path, options = {})
self.logs = []
clone_config = self.config.clone
Expand Down Expand Up @@ -67,8 +68,9 @@ def call(method, path, options = {})
args = [method]
args << generate_payload(options) if [:post, :put].include?(method)
args << headers
starting_arg = options[:no_log_payload] == true ? 2 : 1
self.logs << ([method.upcase, URI.join(client.url, path)] + args[starting_arg..-1]).join(': ')

self.logs << ([method.upcase, URI.join(client.url, path)] + args[1..-1]).join(': ')
response = get_response(client, path, *args)
processed = process_response(response)
self.logs << "Response: #{response.code}: #{response.body}"
Expand Down
2 changes: 1 addition & 1 deletion lib/runcible/resources/content.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def create_upload_request
# @param [File] content content of the file being uploaded to the server
# @return [RestClient::Response] none
def upload_bits(upload_id, offset, content)
call(:put, upload_path("#{upload_id}/#{offset}/"), :payload => content)
call(:put, upload_path("#{upload_id}/#{offset}/"), :payload => content, :no_log_payload => true)
end

# Import into a repository
Expand Down

0 comments on commit c4ec673

Please sign in to comment.