Skip to content

Commit 42ebe6c

Browse files
committed
Add end string anchor to string origin def
Build regex with end string anchor when string is used to configure origin [Fixes #86]
1 parent 3f51048 commit 42ebe6c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: lib/rack/cors.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ def origins(*args, &blk)
253253
/^https?:\/\//,
254254
'file://' then n
255255
when '*' then @public_resources = true; n
256-
else Regexp.compile("^[a-z][a-z0-9.+-]*:\\\/\\\/#{Regexp.quote(n)}")
256+
else Regexp.compile("^[a-z][a-z0-9.+-]*:\\\/\\\/#{Regexp.quote(n)}$")
257257
end
258258
end.flatten
259259
@origins.push(blk) if blk

0 commit comments

Comments
 (0)