joshbuddy / http_router

A kick-ass HTTP router for use in Rack
MIT License
199 stars 45 forks source link

Fix env handling for Rack 2 #48

Closed jamesdabbs closed 1 year ago

jamesdabbs commented 8 years ago

rack#b2d73960e9ea6b8b15321ef190f13a290d1aedf0 introduces the relevant change - In previous versions, request.rack_request.dup.env was still the same object as request.rack_request.env and so updates to it did update the original rack env, which appears to be behavior that we're depending on elsewhere.

Given that we'll often want to update the env (see e.g. hanami/controller's handling of env['hanami.action']), I'm struggling to understand why the dup was there in the first place. But in any case, this gets the tests back passing on Rack '~> 2.0'.