cyu / rack-cors

Rack Middleware for handling Cross-Origin Resource Sharing (CORS), which makes cross-origin AJAX possible.
MIT License
3.26k stars 263 forks source link

NoMethodError: undefined method 'unescape_path' for Rack::Utils:Module #191

Closed prashant-kiwi closed 4 years ago

prashant-kiwi commented 4 years ago

I am getting NoMethodError for 'unescape_path' for Rack::Utils:Module. When I deep dug then found that my project was running on version "1.0.3" but when i deploy the code today then 'rack-cors' gem updated to new version which is "1.0.4"

vrschgn commented 4 years ago

same error

denqxotl commented 4 years ago

Use 1.0.3 version. I have the same error. I believe that u need to have a new version of rack to use rack-cors 1.0.4 So, for old rails/rack versions just use rack-cors 1.0.3

codedeleter commented 4 years ago

I am seeing the same thing. I am on rack 1.6.11 if that helps.

vlad-pisanov commented 4 years ago

Problem is here: https://github.com/cyu/rack-cors/blob/e4d4fc362a4315808927011cbe5afcfe5486f17d/lib/rack/cors.rb#L155

Rack::Utils.unescape_path doesn't exist in Rack 1.x, it requires Rack 2.x

cyu commented 4 years ago

I've pushed up version 1.0.6 (had a mishap with using unescape_path instead of unescape 😔). Sorry about the inconvenience, but thank you so much creating this issue.

cyu commented 4 years ago

I've also yanked 1.0.4 so that it's no longer available.

daande commented 4 years ago

@cyu Thank you for pushing up 1.0.6!

tasos31 commented 4 years ago

this also happens in 1.0.5 (rack >= 1.6.0) for me. after updating to 1.0.6 it seems to work fine please consider disabling 1.0.5 too.

vishalzambre commented 4 years ago

Getting same error after upgrade to rack - 1.6.12 from rack -1.6.11 rack-cors (1.0.5) From rack-cors (1.0.2)

mbijon commented 4 years ago

Github's @dependabot is currently suggesting a bump to 1.0.5, which has this issue.

@cyu could you please yank release 1.0.5 too?

jpowell commented 3 years ago

@cyu see above comments about 1.0.5 - causing the same issue... and @dependabot recommending this version.

cyu commented 3 years ago

@mbijon @jpowell this is a damned if you do, damned if you don't situation - I got my hand slapped for yanking 1.0.4.

Maybe I can convince @dependabot to not recommend 1.0.5? Pretty please @dependabot?

mbijon commented 3 years ago

@cyu how about releasing a reversion/patch as 1.0.6?