24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
# File 'lib/httplog/adapters/ethon.rb', line 24
def perform
return orig_perform unless HttpLog.url_approved?(url)
bm = Benchmark.realtime { orig_perform }
status = .scan(%r{HTTP/... (\d{3})}).flatten.first
encoding = .scan(/Content-Encoding: (\S+)/).flatten.first
content_type = .scan(/Content-Type: (\S+(; charset=\S+)?)/).flatten.first
= .split(/\r?\n/)[1..-1]
HttpLog.log_compact(@action_name, @url, @return_code, bm)
HttpLog.log_status(status)
HttpLog.log_benchmark(bm)
HttpLog.()
HttpLog.log_body(response_body, encoding, content_type)
return_code
end
|