Skip to content

Commit

Permalink
Remove digest_transport.go wrapper
Browse files Browse the repository at this point in the history
Reference: #4599 (review)
Signed-off-by: Eng Zer Jun <[email protected]>
  • Loading branch information
Juneezee committed Mar 4, 2025
1 parent 77bfb81 commit 8d3e74a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 32 deletions.
31 changes: 0 additions & 31 deletions lib/netext/httpext/digest_transport.go

This file was deleted.

15 changes: 14 additions & 1 deletion lib/netext/httpext/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"time"

"github.com/Azure/go-ntlmssp"
"github.com/icholy/digest"
"github.com/sirupsen/logrus"
"gopkg.in/guregu/null.v3"

Expand Down Expand Up @@ -213,7 +214,19 @@ func MakeRequest(ctx context.Context, state *lib.State, preq *ParsedHTTPRequest)
return status == 401 || originalResponseCallback(status)
}
}
transport = digestTransport{originalTransport: transport}

username := preq.URL.u.User.Username()
password, _ := preq.URL.u.User.Password()

// Remove the user data from the URL to avoid sending the authorization
// header for basic auth
preq.URL.u.User = nil

transport = &digest.Transport{
Username: username,
Password: password,
Transport: transport,
}
} else if preq.Auth == "ntlm" {
// The first response of NTLM auth may be a 401 error.
if tracerTransport.responseCallback != nil {
Expand Down

0 comments on commit 8d3e74a

Please sign in to comment.