From 104934e8064519ef091d6a87db8a0d208efeffb9 Mon Sep 17 00:00:00 2001 From: Wojciech Trocki Date: Tue, 26 Mar 2024 16:52:06 +0100 Subject: [PATCH] CLOUDP-237245: adding helper for using Http transport interface (#35) --- digest.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/digest.go b/digest.go index e46d58f..50afd81 100644 --- a/digest.go +++ b/digest.go @@ -124,6 +124,16 @@ 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, + Password: password, + Transport: transport, + } + return t +} + type challenge struct { Realm string Domain string