From e70fb00318b29b79c3e538371f8969c0b84efb9a Mon Sep 17 00:00:00 2001 From: Trong Huu Nguyen Date: Fri, 31 Jan 2025 16:49:53 +0100 Subject: [PATCH] refactor(http): rename attribute keys for consistency --- internal/http/request.go | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/internal/http/request.go b/internal/http/request.go index 8be8a00..df9a13c 100644 --- a/internal/http/request.go +++ b/internal/http/request.go @@ -48,17 +48,17 @@ func Accepts(r *http.Request, accepted ...string) bool { // Attributes returns a map of interesting properties for the request. func Attributes(r *http.Request) map[string]any { return map[string]any{ - "request_cookies": nonEmptyRequestCookies(r), - "request_host": r.Host, - "request_is_navigational": IsNavigationRequest(r), - "request_method": r.Method, - "request_path": r.URL.Path, - "request_protocol": r.Proto, - "request_referer": refererStripped(r), - "request_sec_fetch_dest": r.Header.Get("Sec-Fetch-Dest"), - "request_sec_fetch_mode": r.Header.Get("Sec-Fetch-Mode"), - "request_sec_fetch_site": r.Header.Get("Sec-Fetch-Site"), - "request_user_agent": r.UserAgent(), + "request.cookies": nonEmptyRequestCookies(r), + "request.host": r.Host, + "request.is_navigational": IsNavigationRequest(r), + "request.method": r.Method, + "request.path": r.URL.Path, + "request.protocol": r.Proto, + "request.referer": refererStripped(r), + "request.sec_fetch_dest": r.Header.Get("Sec-Fetch-Dest"), + "request.sec_fetch_mode": r.Header.Get("Sec-Fetch-Mode"), + "request.sec_fetch_site": r.Header.Get("Sec-Fetch-Site"), + "request.user_agent": r.UserAgent(), } }