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

Function validateProxyURL

enterprise/coderd/workspaceproxy.go:400–412  ·  view source on GitHub ↗

nolint:revive

(u string)

Source from the content-addressed store, hash-verified

398
399// nolint:revive
400func validateProxyURL(u string) error {
401 p, err := url.Parse(u)
402 if err != nil {
403 return err
404 }
405 if p.Scheme != "http" && p.Scheme != "https" {
406 return xerrors.New("scheme must be http or https")
407 }
408 if !(p.Path == "/" || p.Path == "") {
409 return xerrors.New("path must be empty or /")
410 }
411 return nil
412}
413
414// @Summary Get workspace proxies
415// @ID get-workspace-proxies

Callers 2

Test_validateProxyURLFunction · 0.85

Calls 2

ParseMethod · 0.65
NewMethod · 0.65

Tested by 1

Test_validateProxyURLFunction · 0.68