MCPcopy Index your code
hub / github.com/labstack/echo / validateOrigin

Function validateOrigin

middleware/util.go:118–130  ·  view source on GitHub ↗
(origin string, what string)

Source from the content-addressed store, hash-verified

116}
117
118func validateOrigin(origin string, what string) error {
119 u, err := url.Parse(origin)
120 if err != nil {
121 return fmt.Errorf("can not parse %s: %w", what, err)
122 }
123 if u.Scheme == "" || u.Host == "" {
124 return fmt.Errorf("%s is missing scheme or host: %s", what, origin)
125 }
126 if u.Path != "" || u.RawQuery != "" || u.Fragment != "" {
127 return fmt.Errorf("%s can not have path, query, and fragments: %s", what, origin)
128 }
129 return nil
130}

Callers 2

validateOriginsFunction · 0.85
ToMiddlewareMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…