mirror of
https://github.com/nxtrace/NTrace-core.git
synced 2026-11-30 08:28:01 +00:00
25 lines
507 B
Go
25 lines
507 B
Go
package ipgeo
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/nxtrace/NTrace-core/util"
|
|
)
|
|
|
|
func isolateNextTraceAPIV4ProxyEnv(t *testing.T) {
|
|
t.Helper()
|
|
for _, key := range []string{"HTTP_PROXY", "HTTPS_PROXY", "NO_PROXY", "http_proxy", "https_proxy", "no_proxy", "REQUEST_METHOD"} {
|
|
t.Setenv(key, "")
|
|
}
|
|
}
|
|
|
|
func isolateNextTraceAPIV4ProxyState(t *testing.T) {
|
|
t.Helper()
|
|
isolateNextTraceAPIV4ProxyEnv(t)
|
|
oldProxy := util.EnvProxyURL
|
|
util.EnvProxyURL = ""
|
|
t.Cleanup(func() {
|
|
util.EnvProxyURL = oldProxy
|
|
})
|
|
}
|