7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
# File 'lib/httplog/adapters/patron.rb', line 7
def request(action_name, url, , options = {})
bm = Benchmark.realtime do
@response = orig_request(action_name, url, , options)
end
if HttpLog.url_approved?(url)
= @response..transform_keys(&:downcase)
HttpLog.call(
method: action_name,
url: url,
request_body: options[:data],
request_headers: ,
response_code: @response.status,
response_body: @response.body,
response_headers: ,
benchmark: bm,
encoding: ['content-encoding'],
content_type: ['content-type'],
mask_body: HttpLog.masked_body_url?(url)
)
end
@response
end
|