Skip to content

Commit

Permalink
HttpRequest doesn't mutate the URI if it's an Addressable::URI
Browse files Browse the repository at this point in the history
If you pass an Addressable::URI into a HttpRequest, it mutates the
instance by setting the port on it. This is unexpected to the caller,
why would the port on the URI be set just by requesting it?

This change clones the uri that's passed in before mutating it.
  • Loading branch information
jagregory committed Feb 27, 2013
1 parent 322f227 commit 6bc3acc
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/em-http/request.rb
Expand Up @@ -3,6 +3,7 @@ class HttpRequest
@middleware = []

def self.new(uri, options={})
uri = uri.clone
connopt = HttpConnectionOptions.new(uri, options)

c = HttpConnection.new
Expand Down

0 comments on commit 6bc3acc

Please sign in to comment.