Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #7 from ivmaykov/master

Fixed a compatibility issue w/ Faraday using Net::HTTP adapter.

Faraday creates a Net::HTTPGenericRequest directly (at 
https://github.com/lostisland/faraday/blob/master/lib/faraday/adapter/net_http.rb#L55),
which does not have a ::METHOD constant defined, so we have to use
#method to get the HTTP method name.
  • Loading branch information...
commit bd9f07e3abb1353d94a888d0c9df1ed80453ba9d 2 parents 662210f + 7979cf3
James Fairbairn authored
Showing with 2 additions and 1 deletion.
  1. +2 −1  lib/em-net-http.rb
3  lib/em-net-http.rb
View
@@ -135,7 +135,8 @@ def request(req, body = nil, &block)
headers['content-type'] ||= "application/x-www-form-urlencoded"
t0 = Time.now
- httpreq = EM::HttpRequest.new(uri).send(req.class::METHOD.downcase.to_sym, opts)
+ request_method = (req.respond_to?(:method) ? req.method : req.class::METHOD).downcase.to_sym
+ httpreq = EM::HttpRequest.new(uri).send(request_method, opts)
f=Fiber.current
Please sign in to comment.
Something went wrong with that request. Please try again.