mirror of
https://github.com/router-for-me/CLIProxyAPI.git
synced 2026-05-14 10:46:28 +08:00
- Updated all references from v6 to v7 for `github.com/router-for-me/CLIProxyAPI`. - Ensured consistency in imports within core libraries, tests, and integration tests. - Added missing tests for new features in Redis Protocol integration.
23 lines
524 B
Go
23 lines
524 B
Go
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")
|
|
}
|
|
}
|