Use Rack::Request instead of env directly. Add comments.