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)
| 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 |
| 131 | func 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]. |
searching dependent graphs…