Skip to content

Commit d6fc6b8

Browse files
escape optimized
1 parent 27a5539 commit d6fc6b8

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/cors.lua

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,7 @@ M.build_pattern = function(pattern)
5757
end
5858

5959
-- escape dots and dashes in pattern
60-
pattern = pattern:gsub("%.", "%%.")
61-
pattern = pattern:gsub("%-", "%%-")
60+
pattern = pattern:gsub("([%.%-])", "%%%1")
6261

6362
-- an asterisk for the port means allow all ports
6463
if string.find(pattern, "[:]+%*$") ~= nil then

0 commit comments

Comments
 (0)