Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 09f7b8e commit 620009eCopy full SHA for 620009e
cli/server.go
@@ -1206,6 +1206,14 @@ func WriteConfigMW(cfg *codersdk.DeploymentValues) clibase.MiddlewareFunc {
1206
// isLocalURL returns true if the hostname of the provided URL appears to
1207
// resolve to a loopback address.
1208
func IsLocalURL(ctx context.Context, u *url.URL) (bool, error) {
1209
+ // In tests, we commonly use "example.com" or "google.com", which
1210
+ // are not loopback, so avoid the DNS lookup to avoid flakes.
1211
+ if flag.Lookup("test.v") != nil {
1212
+ if u.Host == "example.com" || u.Host == "google.com" {
1213
+ return false, nil
1214
+ }
1215
1216
+
1217
resolver := &net.Resolver{}
1218
ips, err := resolver.LookupIPAddr(ctx, u.Hostname())
1219
if err != nil {
0 commit comments