优化结构
This commit is contained in:
@@ -23,6 +23,16 @@ func TestOperationQueryBodyPreservesEncodedSeparators(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestOperationQueryBodyRedactsSensitiveValues(t *testing.T) {
|
||||
var values map[string]string
|
||||
if err := json.Unmarshal(operationQueryBody("token=secret-token&name=alice"), &values); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if values["token"] != redactedValue || values["name"] != "alice" {
|
||||
t.Fatalf("unexpected redacted query body: %#v", values)
|
||||
}
|
||||
}
|
||||
|
||||
func runErrorAudit(t *testing.T, path, response string, logger *slog.Logger) {
|
||||
t.Helper()
|
||||
gin.SetMode(gin.TestMode)
|
||||
|
||||
Reference in New Issue
Block a user