diff --git a/shared_test.go b/shared_test.go index 9368ebd..eb40f81 100644 --- a/shared_test.go +++ b/shared_test.go @@ -2,6 +2,7 @@ package shuffle import ( "testing" + "net/http" ) func TestIsLoop(t *testing.T) { @@ -26,3 +27,17 @@ func TestIsLoop(t *testing.T) { } } } + +// Simple Test for HandleInternalProxy(client) +// set env SHUFFLE_INTERNAL_HTTP_PROXY to test the function. +func TestHandleInternalProxy(t *testing.T) { + client := &http.Client{} + result := HandleInternalProxy(client) + + if result.Transport.(*http.Transport).Proxy != nil { + proxyURL, _ := result.Transport.(*http.Transport).Proxy(nil) + t.Logf("Proxy URL set: %v", proxyURL) + } else { + t.Log("No proxy set") + } +}