fix missing \- in regex expression for CORS wildcard domain (#7904)

This commit is contained in:
Christopher Larivière 2021-11-11 13:26:08 -05:00 committed by GitHub
parent af232df1af
commit 100057d0c5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 1 deletions

View file

@ -1680,7 +1680,7 @@ func convertGoSliceIntoLuaTable(goSliceInterface interface{}, emptyStringAsNil b
func buildOriginRegex(origin string) string {
origin = regexp.QuoteMeta(origin)
origin = strings.Replace(origin, "\\*", "[A-Za-z0-9]+", 1)
origin = strings.Replace(origin, "\\*", `[A-Za-z0-9\-]+`, 1)
return fmt.Sprintf("(%s)", origin)
}