MiniProfiler / rack-mini-profiler

Profiler for your development and production Ruby rack apps.
MIT License
3.69k stars 401 forks source link

Fix ArgumentError: comparison of String with 200 failed #520

Closed mickeytgl closed 2 years ago

mickeytgl commented 2 years ago

Casts the status to an integer before comparison.

Issue

Related PRs and Issues

SamSaffron commented 2 years ago

I am very mixed on this ... who up in the stack is sending a "200" string? I accepted this in memory_profiler years ago, but there have been so many intervening years to fix this and something up your stack is returning strings as status which is not correct.

mickeytgl commented 2 years ago

👋🏻 Thanks for the quick response, yeah, I definitely agree that the true fix would be to dig into my stack call to see what is generating a 200 string, and I am trying to find out the culprit there. That being said, I think it's also nice to have this small safety net and that it does not add too much overhead having it, but of course, it's just a proposal

mickeytgl commented 2 years ago

Hello 👋🏻 Bumping this to either get it in, further discuss it or close it

SamSaffron commented 2 years ago

Yeah I prefer this be fixed upstream, feels odd to be responsible for fixing bugs further up the middleware stack.