Skip to content
Browse files

fix bug when no auth provided

  • Loading branch information...
1 parent feb35db commit 14739fb18b00c96a8b7c4b50c9e7239f5912682c shutl committed Aug 30, 2013
Showing with 7 additions and 4 deletions.
  1. +6 −3 lib/shutl/resource/default_logger.rb
  2. +1 −1 lib/shutl/resource/version.rb
View
9 lib/shutl/resource/default_logger.rb
@@ -39,14 +39,17 @@ def response_info(env, response_time)
end
def request_debug(env)
- request_headers = strip_auth env[:request_headers]
+ request_headers = obfuscate_auth env[:request_headers]
debug_message("Request", request_headers, env[:body])
end
- def strip_auth(headers)
+ def obfuscate_auth(headers)
headers.dup.tap do |h|
- h["Authorization"] = h["Authorization"][0..3] << "***" << h["Authorization"][-4..-1]
+ if auth = h["Authorization"]
+ #display first few and last few characters
+ h["Authorization"] = "#{auth[0..10]}****#{auth[-4..-1]}"
+ end
end
end
View
2 lib/shutl/resource/version.rb
@@ -1,5 +1,5 @@
module Shutl
module Resource
- VERSION = '1.3.4'
+ VERSION = '1.3.5'
end
end

0 comments on commit 14739fb

Please sign in to comment.
Something went wrong with that request. Please try again.