Closed johnknapp closed 1 year ago
@johnknapp try /\Ahttps?:\/\/example\.com\z/
. That's the syntax for a regex literal
Thank you Calvin! That did the trick!
I first tried with quotes which did not work. After removing the quotes, with the forward slashes instead, life is good!!
Just as you recommended, the block looks like this:
allow do
origins /\Ahttps?:\/\/example\.com\z/
resource '*', credentials: true, headers: :any, max_age: 600, methods: allowed_methods
end
Our dev team will be so happy that our GH preview builds work now!
Thanks again and keep up the good work on rack-cors!
First off, rack-cors rocks! I've used it on numerous projects but not with regex origins.
I'm on rack-cors 1.1 / rails 7.0.1 / ruby 2.7.7
Is there something wrong with my rack-cors regex origin syntax? (attached screen grab)