MCPcopy Index your code
hub / github.com/rilldata/rill / WithCustomDomain

Method WithCustomDomain

admin/urls.go:57–80  ·  view source on GitHub ↗

WithCustomDomain returns a copy that generates URLs for the provided custom domain (as described in the type doc). The result automatically generates correct URLs also for the few endpoints that must always use the non-custom external URL (such as AuthLogin).

(domain string)

Source from the content-addressed store, hash-verified

55// WithCustomDomain returns a copy that generates URLs for the provided custom domain (as described in the type doc).
56// The result automatically generates correct URLs also for the few endpoints that must always use the non-custom external URL (such as AuthLogin).
57func (u *URLs) WithCustomDomain(domain string) *URLs {
58 if u.custom != "" {
59 panic(fmt.Errorf("nested calls to WithCustomDomain are not allowed"))
60 }
61
62 if domain == "" {
63 return u
64 }
65
66 custom := &url.URL{
67 Scheme: "https",
68 Host: domain,
69 }
70 if !u.https {
71 custom.Scheme = "http"
72 }
73
74 return &URLs{
75 external: u.external,
76 frontend: u.frontend,
77 custom: custom.String(),
78 https: u.https,
79 }
80}
81
82// IsSafeRedirectURL reports whether redirect is safe to redirect to after an auth flow.
83// A redirect is safe when it is:

Callers 14

StartDeploymentInnerMethod · 0.80
GetReportMetaMethod · 0.80
IssueMagicAuthTokenMethod · 0.80
magicAuthTokenToPBMethod · 0.80
AddProjectMemberUserMethod · 0.80
RequestProjectAccessMethod · 0.80
ApproveProjectAccessMethod · 0.80
GetAlertMetaMethod · 0.80
GetIFrameMethod · 0.80
GetDeploymentConfigMethod · 0.80

Calls 2

StringMethod · 0.95
ErrorfMethod · 0.65

Tested by

no test coverage detected