Skip to content

Commit

Permalink
Added headers setter to request signature which normalizes headers be…
Browse files Browse the repository at this point in the history
…fore assignment
  • Loading branch information
bblimke committed Nov 10, 2010
1 parent 0c904c9 commit 561c6e1
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/webmock/request_signature.rb
Expand Up @@ -2,7 +2,8 @@ module WebMock

class RequestSignature

attr_accessor :method, :uri, :body, :headers
attr_accessor :method, :uri, :body
attr_reader :headers

def initialize(method, uri, options = {})
self.method = method
Expand All @@ -20,11 +21,15 @@ def to_s
string
end

def headers=(headers)
@headers = WebMock::Util::Headers.normalize_headers(headers)
end

private

def assign_options(options)
self.body = options[:body] if options.has_key?(:body)
self.headers = WebMock::Util::Headers.normalize_headers(options[:headers]) if options.has_key?(:headers)
self.headers = options[:headers] if options.has_key?(:headers)
end

end
Expand Down

0 comments on commit 561c6e1

Please sign in to comment.