From 826af511569d971451cda5971fafad6c5bb3755e Mon Sep 17 00:00:00 2001 From: Wojciech Trocki Date: Tue, 26 Mar 2024 16:34:40 +0100 Subject: [PATCH 1/2] CLOUDP-237245: adding helper for using Http transport interface --- digest.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/digest.go b/digest.go index e46d58f..d2433e5 100644 --- a/digest.go +++ b/digest.go @@ -124,6 +124,16 @@ func NewTransportWithHTTPTransport(username, password string, transport *http.Tr return t } + +func NewTransportWithHTTPRoundTripper(username, password string, transport http.RoundTripper) *Transport { + t := &Transport{ + Username: username, + Password: password, + Transport: transport, + } + return t +} + type challenge struct { Realm string Domain string From b4c6b7d662437b5321c7b015622ee2d8a10e0bd1 Mon Sep 17 00:00:00 2001 From: Wojciech Trocki Date: Tue, 26 Mar 2024 16:38:41 +0100 Subject: [PATCH 2/2] fix: comment --- digest.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/digest.go b/digest.go index d2433e5..50afd81 100644 --- a/digest.go +++ b/digest.go @@ -124,7 +124,7 @@ func NewTransportWithHTTPTransport(username, password string, transport *http.Tr return t } - +// NewTransportWithHTTPRoundTripper creates a new digest transport using the supplied http.RoundTripper interface. func NewTransportWithHTTPRoundTripper(username, password string, transport http.RoundTripper) *Transport { t := &Transport{ Username: username,