Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: na-- <[email protected]>
  • Loading branch information
mstoykov and na-- authored Mar 1, 2021
1 parent 5b3c26b commit 0cf258a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions lib/netext/httpext/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -270,8 +270,8 @@ func MakeRequest(ctx context.Context, preq *ParsedHTTPRequest) (*Response, error
}

if preq.Auth == "digest" {
// In both digest and NTLM it is expected that the first response will be 401
// this does mean that a non 401 response will be marked as failed/unexpected
// Until digest authentication is refactored, the first response will always
// be a 401 error, so we expect that.
if tracerTransport.responseCallback != nil {
originalResponseCallback := tracerTransport.responseCallback
tracerTransport.responseCallback = func(status int) bool {
Expand All @@ -281,6 +281,7 @@ func MakeRequest(ctx context.Context, preq *ParsedHTTPRequest) (*Response, error
}
transport = digestTransport{originalTransport: transport}
} else if preq.Auth == "ntlm" {
// The first response of NTLM auth may be a 401 error.
if tracerTransport.responseCallback != nil {
originalResponseCallback := tracerTransport.responseCallback
tracerTransport.responseCallback = func(status int) bool {
Expand Down
2 changes: 1 addition & 1 deletion stats/units.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func ToD(d float64) time.Duration {
return time.Duration(d * float64(timeUnit))
}

// B formats a boolena for emission
// B formats a boolean value for emission.
func B(b bool) float64 {
if b {
return 1
Expand Down

0 comments on commit 0cf258a

Please sign in to comment.