feat: allow CORS for 127.0.0.1

This commit is contained in:
Yang Luo
2023-09-27 14:10:59 +08:00
parent 06e3b8481f
commit 5c89705d9e
2 changed files with 2 additions and 2 deletions

View File

@ -57,7 +57,7 @@ func CorsFilter(ctx *context.Context) {
originHostname := getHostname(origin)
host := ctx.Request.Host
if strings.HasPrefix(origin, "http://localhost") {
if strings.HasPrefix(origin, "http://localhost") || strings.HasPrefix(origin, "http://127.0.0.1") {
setCorsHeaders(ctx, origin)
return
}