lib/httpx/adapters/webmock.rb in httpx-0.22.5 vs lib/httpx/adapters/webmock.rb in httpx-0.23.0

- old
+ new

@@ -21,11 +21,11 @@ uri = WebMock::Util::URI.heuristic_parse(request.uri) uri.query = request.query uri.path = uri.normalized_path.gsub("[^:]//", "/") WebMock::RequestSignature.new( - request.verb, + request.verb.downcase.to_sym, uri.to_s, body: request.body.each.to_a.join, headers: request.headers.to_h ) end @@ -120,10 +120,10 @@ class HttpxAdapter < HttpLibAdapter adapter_for :httpx class << self def enable! - @original_session = HTTPX::Session + @original_session ||= HTTPX::Session webmock_session = HTTPX.plugin(Plugin) HTTPX.send(:remove_const, :Session) HTTPX.send(:const_set, :Session, webmock_session.class)