MCPcopy Index your code
hub / github.com/coder/coder / ValidateRedirectURIScheme

Function ValidateRedirectURIScheme

codersdk/oauth2_validation.go:92–94  ·  view source on GitHub ↗

ValidateRedirectURIScheme reports whether the callback URL's scheme is safe to use as a redirect target. It returns an error when the scheme is empty, an unsupported URN, or one of the schemes that are dangerous in browser/HTML contexts (javascript, data, file, ftp). Legitimate custom schemes for n

(u *url.URL)

Source from the content-addressed store, hash-verified

90// Legitimate custom schemes for native apps (e.g. vscode://, jetbrains://)
91// are allowed.
92func ValidateRedirectURIScheme(u *url.URL) error {
93 return validateScheme(u)
94}
95
96func validateScheme(u *url.URL) error {
97 if u.Scheme == "" {

Callers 1

ShowAuthorizePageFunction · 0.92

Calls 1

validateSchemeFunction · 0.85

Tested by

no test coverage detected