Skip to content

Commit 4204f7f

Browse files
Escape dashes in origin pattern
1 parent 771c900 commit 4204f7f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/cors.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,9 @@ M.build_pattern = function(pattern)
6161
pattern = pattern:gsub("[:]+%*$", "[:]+[0-9]+")
6262
end
6363

64-
-- escape dots in pattern
64+
-- escape dots and dashes in pattern
6565
pattern = pattern:gsub("%.", "%%.")
66+
pattern = pattern:gsub("%-", "%%-")
6667

6768
-- append end character
6869
pattern = pattern .. "$"

0 commit comments

Comments
 (0)