17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
# File 'lib/tcell_agent/rust/models.rb', line 17
def self.create_request_response(appsensor_meta)
post_params = convert_params(appsensor_meta.flattened_post_dict) +
convert_params(appsensor_meta.flattened_body_dict)
request_response = {
'method' => appsensor_meta.method,
'status_code' => appsensor_meta.response_code.to_i,
'route_id' => appsensor_meta.route_id,
'path' => appsensor_meta.path,
'query_params' => convert_params(appsensor_meta.flattened_get_dict),
'post_params' => post_params,
'headers' => convert_params(appsensor_meta.),
'cookies' => convert_params(appsensor_meta.flattened_cookie_dict),
'path_params' => convert_params(appsensor_meta.flattened_path_parameters),
'remote_address' => appsensor_meta.remote_address,
'full_uri' => appsensor_meta.location,
'session_id' => appsensor_meta.session_id,
'user_id' => appsensor_meta.user_id,
'user_agent' => appsensor_meta.user_agent,
'request_bytes_length' => appsensor_meta.request_content_bytes_len,
'response_bytes_length' => appsensor_meta.response_content_bytes_len
}
if TCellAgent::Utils::Strings.present?(appsensor_meta.csrf_exception_name)
request_response['csrf_exception'] = { 'exception_name' => appsensor_meta.csrf_exception_name }
end
if appsensor_meta.sql_exceptions
request_response['sql_exceptions'] = appsensor_meta.sql_exceptions
end
if appsensor_meta.database_result_sizes
request_response['database_result_sizes'] = appsensor_meta.database_result_sizes
end
request_response
end
|