@@ -53,8 +53,6 @@ import (
53
53
"gopkg.in/yaml.v3"
54
54
"tailscale.com/tailcfg"
55
55
56
- "github.com/coder/pretty"
57
-
58
56
"cdr.dev/slog"
59
57
"cdr.dev/slog/sloggers/sloghuman"
60
58
"github.com/coder/coder/v2/buildinfo"
@@ -75,7 +73,6 @@ import (
75
73
"github.com/coder/coder/v2/coderd/devtunnel"
76
74
"github.com/coder/coder/v2/coderd/externalauth"
77
75
"github.com/coder/coder/v2/coderd/gitsshkey"
78
- "github.com/coder/coder/v2/coderd/httpapi"
79
76
"github.com/coder/coder/v2/coderd/httpmw"
80
77
"github.com/coder/coder/v2/coderd/oauthpki"
81
78
"github.com/coder/coder/v2/coderd/prometheusmetrics"
@@ -89,6 +86,7 @@ import (
89
86
"github.com/coder/coder/v2/coderd/util/slice"
90
87
stringutil "github.com/coder/coder/v2/coderd/util/strings"
91
88
"github.com/coder/coder/v2/coderd/workspaceapps"
89
+ "github.com/coder/coder/v2/coderd/workspaceapps/appurl"
92
90
"github.com/coder/coder/v2/codersdk"
93
91
"github.com/coder/coder/v2/codersdk/drpc"
94
92
"github.com/coder/coder/v2/cryptorand"
@@ -99,6 +97,7 @@ import (
99
97
"github.com/coder/coder/v2/provisionersdk"
100
98
sdkproto "github.com/coder/coder/v2/provisionersdk/proto"
101
99
"github.com/coder/coder/v2/tailnet"
100
+ "github.com/coder/pretty"
102
101
"github.com/coder/retry"
103
102
"github.com/coder/wgtunnel/tunnelsdk"
104
103
)
@@ -434,11 +433,11 @@ func (r *RootCmd) Server(newAPI func(context.Context, *coderd.Options) (*coderd.
434
433
435
434
if vals .WildcardAccessURL .String () == "" {
436
435
// Suffixed wildcard access URL.
437
- u , err := url .Parse (fmt .Sprintf ("*--%s" , tunnel .URL .Hostname ()))
436
+ wu := fmt .Sprintf ("*--%s" , tunnel .URL .Hostname ())
437
+ err = vals .WildcardAccessURL .Set (wu )
438
438
if err != nil {
439
- return xerrors .Errorf ("parse wildcard url: %w" , err )
439
+ return xerrors .Errorf ("set wildcard access url %q : %w" , wu , err )
440
440
}
441
- vals .WildcardAccessURL = clibase .URL (* u )
442
441
}
443
442
}
444
443
@@ -513,7 +512,7 @@ func (r *RootCmd) Server(newAPI func(context.Context, *coderd.Options) (*coderd.
513
512
appHostname := vals .WildcardAccessURL .String ()
514
513
var appHostnameRegex * regexp.Regexp
515
514
if appHostname != "" {
516
- appHostnameRegex , err = httpapi .CompileHostnamePattern (appHostname )
515
+ appHostnameRegex , err = appurl .CompileHostnamePattern (appHostname )
517
516
if err != nil {
518
517
return xerrors .Errorf ("parse wildcard access URL %q: %w" , appHostname , err )
519
518
}
0 commit comments