Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1f9e192001 |
@@ -163,10 +163,7 @@ func TestHandleReportLogsClientIDCutToBound(t *testing.T) {
|
|||||||
|
|
||||||
h.HandleReport().ServeHTTP(rec, req)
|
h.HandleReport().ServeHTTP(rec, req)
|
||||||
|
|
||||||
var logged struct {
|
var logged map[string]any
|
||||||
ClientID string `json:"client_id"`
|
|
||||||
Timestamp string `json:"timestamp"`
|
|
||||||
}
|
|
||||||
|
|
||||||
err := json.Unmarshal(logbuf.Bytes(), &logged)
|
err := json.Unmarshal(logbuf.Bytes(), &logged)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -175,14 +172,14 @@ func TestHandleReportLogsClientIDCutToBound(t *testing.T) {
|
|||||||
|
|
||||||
want := long[:handlers.MaxLoggedFieldBytes]
|
want := long[:handlers.MaxLoggedFieldBytes]
|
||||||
|
|
||||||
if logged.ClientID != want {
|
if logged["client_id"] != want {
|
||||||
t.Fatalf("logged client_id is %d bytes, want %d",
|
t.Fatalf("logged client_id not cut to %d bytes: %q",
|
||||||
len(logged.ClientID), len(want))
|
handlers.MaxLoggedFieldBytes, logged["client_id"])
|
||||||
}
|
}
|
||||||
|
|
||||||
if logged.Timestamp != want {
|
if logged["timestamp"] != want {
|
||||||
t.Fatalf("logged timestamp is %d bytes, want %d",
|
t.Fatalf("logged timestamp not cut to %d bytes: %q",
|
||||||
len(logged.Timestamp), len(want))
|
handlers.MaxLoggedFieldBytes, logged["timestamp"])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user