Add projects
This commit is contained in:
parent
2d3a9ad623
commit
8b607dd700
1802 changed files with 503346 additions and 2 deletions
22
backend/sdk/cliproxy/rtprovider_test.go
Normal file
22
backend/sdk/cliproxy/rtprovider_test.go
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
package cliproxy
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"testing"
|
||||
|
||||
coreauth "github.com/router-for-me/CLIProxyAPI/v7/sdk/cliproxy/auth"
|
||||
)
|
||||
|
||||
func TestRoundTripperForDirectBypassesProxy(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
provider := newDefaultRoundTripperProvider()
|
||||
rt := provider.RoundTripperFor(&coreauth.Auth{ProxyURL: "direct"})
|
||||
transport, ok := rt.(*http.Transport)
|
||||
if !ok {
|
||||
t.Fatalf("transport type = %T, want *http.Transport", rt)
|
||||
}
|
||||
if transport.Proxy != nil {
|
||||
t.Fatal("expected direct transport to disable proxy function")
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue