Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix inefficient assert pattern in Rack::Lint
Partial backport of 1970771 This fixes an issue encountered when adding `Rack::Lint` to the Rails test suite. Rails puts a lazily evaluated class inside the request env that has the potential to raise when converted to a string. Since this assertion in `Rack::Lint` calls `#inspect` on `env` whether or not `env` is a `Hash`, the lazily evaluated class would raise at that point and prevent the rest of `Rack::Lint` from validating the conformity of the request. By backporting this change, `#inspect` is now only called when the `LintError` would be raised which avoids the problem. Co-authored-by: Benoit Daloze <eregontp@gmail.com>
- Loading branch information