File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -493,6 +493,13 @@ func (p *DBTokenProvider) auditInitAutocommitRequest(ctx context.Context, w http
493
493
}
494
494
}
495
495
496
+ // Mimic the behavior of a HTTP status writer
497
+ // by defaulting to 200 if the status is 0.
498
+ status := sw .Status
499
+ if status == 0 {
500
+ status = http .StatusOK
501
+ }
502
+
496
503
// We use the background audit function instead of init request
497
504
// here because we don't know the resource type ahead of time.
498
505
// This also allows us to log unauthenticated access.
@@ -508,7 +515,7 @@ func (p *DBTokenProvider) auditInitAutocommitRequest(ctx context.Context, w http
508
515
UserID : userID .UUID ,
509
516
RequestID : sessionID ,
510
517
Time : aReq .time ,
511
- Status : sw . Status ,
518
+ Status : status ,
512
519
IP : aReq .ip .IPNet .IP .String (),
513
520
UserAgent : r .UserAgent (),
514
521
New : aReq .dbReq .App ,
@@ -525,7 +532,7 @@ func (p *DBTokenProvider) auditInitAutocommitRequest(ctx context.Context, w http
525
532
UserID : userID .UUID ,
526
533
RequestID : sessionID ,
527
534
Time : aReq .time ,
528
- Status : sw . Status ,
535
+ Status : status ,
529
536
IP : aReq .ip .IPNet .IP .String (),
530
537
UserAgent : r .UserAgent (),
531
538
New : aReq .dbReq .Agent ,
You can’t perform that action at this time.
0 commit comments