Skip to content
Permalink
Browse files

Add end string anchor to string origin def

Build regex with end string anchor when string is used to configure
origin

[Fixes #86]
  • Loading branch information...
cyu committed Oct 13, 2015
1 parent 3f51048 commit 42ebe6caa8e85ffa9c8a171bda668ba1acc7a5e6
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/rack/cors.rb
@@ -253,7 +253,7 @@ def origins(*args, &blk)
/^https?:\/\//,
'file://' then n
when '*' then @public_resources = true; n
else Regexp.compile("^[a-z][a-z0-9.+-]*:\\\/\\\/#{Regexp.quote(n)}")
else Regexp.compile("^[a-z][a-z0-9.+-]*:\\\/\\\/#{Regexp.quote(n)}$")
end
end.flatten
@origins.push(blk) if blk

0 comments on commit 42ebe6c

Please sign in to comment.
You can’t perform that action at this time.