28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
# File 'lib/vigiles/conversation_recorders/application_json.rb', line 28
def record(req:, res:)
ensure_content_type_matches!(req)
response = Response.from(res)
request = Request.from(req)
Conversation.create!(
request_content_type: request.content_type,
request_user_agent: request.user_agent,
request_timestamp: request.timestamp,
request_remote_ip: request.remote_ip,
request_protocol: request.protocol,
request_headers: request.,
request_origin: request.origin,
request_payload: request.payload,
request_method: request.http_method.serialize,
request_path: request.path,
request_url: request.url,
request_id: request.id,
response_content_type: response.content_type,
response_headers: response.,
response_payload: response.payload,
response_status: response.status
)
end
|