mirror of
https://github.com/hanzoai/traces.git
synced 2026-10-30 18:20:41 +00:00
* chore: add query-frontend option to select request headers in query logs * chore: added changelog entry * Update modules/frontend/handler.go Co-authored-by: Mario <[email protected]> * Update modules/frontend/handler.go Co-authored-by: Mario <[email protected]> * chore: fix typo in a name --------- Co-authored-by: Mario <[email protected]>
24 lines
478 B
Go
24 lines
478 B
Go
package frontend
|
|
|
|
import (
|
|
"net/http"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestFormatRequestHeaders(t *testing.T) {
|
|
h := http.Header{}
|
|
h.Add("X-Header-To-Log", "i should be logged!")
|
|
h.Add("X-Header-To-Not-Log", "i shouldn't be logged!")
|
|
|
|
fields := formatRequestHeaders(&h, []string{"X-Header-To-Log", "X-Header-Not-Present"})
|
|
|
|
expected := []interface{}{
|
|
"header_x_header_to_log",
|
|
"i should be logged!",
|
|
}
|
|
|
|
require.Equal(t, expected, fields)
|
|
}
|