Skip to content

Commit 5f1e88e

Browse files
committed
Add method on logs
1 parent 788faeb commit 5f1e88e

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Diff for: src/redirectionio_protocol.c

+5-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ static char errbuf[1024];
1111
const char COMMAND_MATCH_NAME[] = "MATCH_WITH_RESPONSE";
1212
const char COMMAND_MATCH_QUERY[] = "{ \"project_id\": \"%s\", \"request_uri\": \"%s\", \"host\": \"%s\" }";
1313
const char COMMAND_LOG_NAME[] = "LOG";
14-
const char COMMAND_LOG_QUERY[] = "{ \"project_id\": \"%s\", \"request_uri\": \"%s\", \"host\": \"%s\", \"rule_id\": \"%s\", \"target\": \"%s\", \"status_code\": %d, \"user_agent\": \"%s\", \"referer\": \"%s\" }";
14+
const char COMMAND_LOG_QUERY[] = "{ \"project_id\": \"%s\", \"request_uri\": \"%s\", \"host\": \"%s\", \"rule_id\": \"%s\", \"target\": \"%s\", \"status_code\": %d, \"user_agent\": \"%s\", \"referer\": \"%s\", \"method\": \"%s\" }";
1515
const char COMMAND_FILTER_HEADER_NAME[] = "FILTER_HEADER";
1616
const char COMMAND_FILTER_BODY_NAME[] = "FILTER_BODY";
1717

@@ -129,7 +129,8 @@ apr_status_t redirectionio_protocol_log(redirectionio_connection *conn, redirect
129129
+ 3 // Status code length
130130
+ strlen(user_agent)
131131
+ strlen(referer)
132-
- 16 // 8 * 2 (%x) characters replaced with values
132+
+ strlen(r->method)
133+
- 18 // 9 * 2 (%x) characters replaced with values
133134
;
134135

135136
dst = (char *) apr_palloc(r->pool, wlen);
@@ -144,7 +145,8 @@ apr_status_t redirectionio_protocol_log(redirectionio_connection *conn, redirect
144145
location,
145146
r->status,
146147
user_agent,
147-
referer
148+
referer,
149+
r->method
148150
);
149151

150152
clen = sizeof(COMMAND_LOG_NAME);

0 commit comments

Comments
 (0)