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
|
// Check allowed origins
|
||||||
for _, o := range config.AllowOrigins {
|
for _, o := range config.AllowOrigins {
|
||||||
|
if o == "*" && config.AllowCredentials {
|
||||||
|
allowOrigin = origin
|
||||||
|
break
|
||||||
|
}
|
||||||
if o == "*" || o == origin {
|
if o == "*" || o == origin {
|
||||||
allowOrigin = o
|
allowOrigin = o
|
||||||
break
|
break
|
||||||
|
Loading…
Reference in New Issue
Block a user