mirror of
https://github.com/labstack/echo.git
synced 2024-12-24 20:14:31 +02:00
handle using withcredentials and allow origin * together
This commit is contained in:
parent
9b4cc60ce2
commit
d63824fa41
@ -94,6 +94,10 @@ func CORSWithConfig(config CORSConfig) echo.MiddlewareFunc {
|
||||
|
||||
// Check allowed origins
|
||||
for _, o := range config.AllowOrigins {
|
||||
if o == "*" && config.AllowCredentials {
|
||||
allowOrigin = origin
|
||||
break
|
||||
}
|
||||
if o == "*" || o == origin {
|
||||
allowOrigin = o
|
||||
break
|
||||
|
Loading…
Reference in New Issue
Block a user