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