Clone the URI before mutating it. #184

Merged
merged 1 commit into from May 21, 2012

Projects

None yet

2 participants

@jonleighton

The #build_request_signature method was mutating the URI if there were
any @req.query options. This means that if the request does actually get
sent, em-http-request appends the query to the URI a second time, and
the parameters are repeated.

For example:

EventMachine::HttpRequest.new('http://example.com/').get(:query => { :a => '1' })

would result in the follow URI being used for a live request:

http://example.com/?a=1&a=1

@jonleighton jonleighton Clone the URI before mutating it.
The #build_request_signature method was mutating the URI if there were
any @req.query options. This means that if the request does actually get
sent, em-http-request appends the query to the URI a second time, and
the parameters are repeated.

For example:

EventMachine::HttpRequest.new('http://example.com/').get(:query => { :a => '1' })

would result in the follow URI being used for a live request:

http://example.com/?a=1&a=1
6927943
@bblimke bblimke merged commit 887bf32 into bblimke:master May 21, 2012
@bblimke
Owner
bblimke commented May 21, 2012

Looks good, it will be included in the next patch release this week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment