Skip to content

Commit

Permalink
Merge pull request #105 from humanmade/user-agent
Browse files Browse the repository at this point in the history
Include user agent in Xray traces
  • Loading branch information
joehoyle authored Dec 5, 2024
2 parents 2ca810b + 3b702a8 commit 01a207b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions inc/namespace.php
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,7 @@ function get_in_progress_trace() : array {
'method' => $_SERVER['REQUEST_METHOD'],
'url' => ( empty( $_SERVER['HTTPS'] ) ? 'http' : 'https' ) . '://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'],
'client_ip' => $_SERVER['REMOTE_ADDR'],
'user_agent' => $_SERVER['HTTP_USER_AGENT'],
],
],
'in_progress' => true,
Expand Down Expand Up @@ -464,6 +465,7 @@ function get_end_trace() : array {
'method' => $_SERVER['REQUEST_METHOD'],
'url' => ( empty( $_SERVER['HTTPS'] ) ? 'http' : 'https' ) . '://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'],
'client_ip' => $_SERVER['REMOTE_ADDR'],
'user_agent' => $_SERVER['HTTP_USER_AGENT'],
],
'response' => [
'status' => http_response_code(),
Expand Down

0 comments on commit 01a207b

Please sign in to comment.