MCPcopy
hub / github.com/labstack/echo / CORS

Function CORS

middleware/cors.go:131–136  ·  view source on GitHub ↗

CORS returns a Cross-Origin Resource Sharing (CORS) middleware. See also [MDN: Cross-Origin Resource Sharing (CORS)]. Origin consist of following parts: `scheme + "://" + host + optional ":" + port` Wildcard `*` can be used, but has to be set explicitly. Example: `https://example.com`, `http://exam

(allowOrigins ...string)

Source from the content-addressed store, hash-verified

129// [Exploiting CORS misconfigurations for Bitcoins and bounties]: https://blog.portswigger.net/2016/10/exploiting-cors-misconfigurations-for.html
130// [Portswigger: Cross-origin resource sharing (CORS)]: https://portswigger.net/web-security/cors
131func CORS(allowOrigins ...string) echo.MiddlewareFunc {
132 c := CORSConfig{
133 AllowOrigins: allowOrigins,
134 }
135 return CORSWithConfig(c)
136}
137
138// CORSWithConfig returns a CORS middleware with config or panics on invalid configuration.
139// See: [CORS].

Callers 1

TestCORSFunction · 0.85

Calls 1

CORSWithConfigFunction · 0.85

Tested by 1

TestCORSFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…