Skip to content
Permalink
Browse files Browse the repository at this point in the history
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 42ebe6c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/rack/cors.rb
Expand Up @@ -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
Expand Down

0 comments on commit 42ebe6c

Please sign in to comment.