class WebMock::HttpLibAdapters::PatronAdapter::WebMockPatronSession
def handle_request(req)
def handle_request(req) request_signature = WebMock::HttpLibAdapters::PatronAdapter.build_request_signature(req) WebMock::RequestRegistry.instance.requested_signatures.put(request_signature) if webmock_response = WebMock::StubRegistry.instance.response_for_request(request_signature) WebMock::HttpLibAdapters::PatronAdapter. handle_file_name(req, webmock_response) res = WebMock::HttpLibAdapters::PatronAdapter. build_patron_response(webmock_response, default_response_charset) WebMock::CallbackRegistry.invoke_callbacks( {lib: :patron}, request_signature, webmock_response) res elsif WebMock.net_connect_allowed?(request_signature.uri) res = super if WebMock::CallbackRegistry.any_callbacks? webmock_response = WebMock::HttpLibAdapters::PatronAdapter. build_webmock_response(res) WebMock::CallbackRegistry.invoke_callbacks( {lib: :patron, real_request: true}, request_signature, webmock_response) end res else raise WebMock::NetConnectNotAllowedError.new(request_signature) end end