Skip to content

Commit

Permalink
internal/appsec: pass http.clientIP through operation args
Browse files Browse the repository at this point in the history
  • Loading branch information
Hellzy committed Oct 26, 2022
1 parent 0fe4a87 commit 6174747
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/appsec/dyngo/instrumentation/httpsec/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ type (
Query map[string][]string
// PathParams corresponds to the address `server.request.path_params`
PathParams map[string]string
// ClientIP corresponds to the addres `http.client_ip`
ClientIP netaddrIP
}

// HandlerOperationRes is the HTTP handler operation results.
Expand Down Expand Up @@ -123,6 +125,7 @@ func MakeHandlerOperationArgs(r *http.Request, pathParams map[string]string) Han
Cookies: cookies,
Query: r.URL.Query(), // TODO(Julio-Guerra): avoid actively parsing the query values thanks to dynamic instrumentation
PathParams: pathParams,
ClientIP: IPFromRequest(r),
}
}

Expand Down

0 comments on commit 6174747

Please sign in to comment.