{"action":"created","issue":{"url":"https://api.github.com/repos/intridea/grape/issues/559","labels_url":"https://api.github.com/repos/intridea/grape/issues/559/labels{/name}","comments_url":"https://api.github.com/repos/intridea/grape/issues/559/comments","events_url":"https://api.github.com/repos/intridea/grape/issues/559/events","html_url":"https://github.com/intridea/grape/issues/559","id":26354299,"number":559,"title":"params 'missing'  due to rack bug","user":{"login":"myitcv","id":3374574,"avatar_url":"https://avatars.githubusercontent.com/u/3374574?v=3","gravatar_id":"","url":"https://api.github.com/users/myitcv","html_url":"https://github.com/myitcv","followers_url":"https://api.github.com/users/myitcv/followers","following_url":"https://api.github.com/users/myitcv/following{/other_user}","gists_url":"https://api.github.com/users/myitcv/gists{/gist_id}","starred_url":"https://api.github.com/users/myitcv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/myitcv/subscriptions","organizations_url":"https://api.github.com/users/myitcv/orgs","repos_url":"https://api.github.com/users/myitcv/repos","events_url":"https://api.github.com/users/myitcv/events{/privacy}","received_events_url":"https://api.github.com/users/myitcv/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/intridea/grape/labels/confirmed+bug","name":"confirmed bug","color":"e10c02"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2014-01-27T14:02:01Z","updated_at":"2015-01-02T16:33:03Z","closed_at":"2015-01-02T16:32:21Z","body":"[This commit in `rack`](https://github.com/rack/rack/commit/b0593078ce792a380779528a6a135c066aa03515) fixes an issue whereby all requests which use a temp file (all requests larger 128 kb?) fail to be properly parsed.\r\n\r\nThe issue manifests itself in `grape` in the following way:\r\n\r\n```ruby\r\nparams do\r\n  optional :picture, type: String\r\nend\r\npatch '/' do\r\n  picture_from_params = params[:picture] # nil - but should not be\r\n  picture_from_env = env['rack.request.form_hash']['picture'] # not nil - as expected\r\n\r\n  env[\"rack.request.form_input\"].eql? env[\"rack.input\"] # false - THIS IS THE BUG fixed by the commit in rack\r\n  env[\"rack.request.form_input\"].equal? env[\"rack.input\"] # true\r\nend\r\n```\r\n\r\nIndeed this could have been the root cause of a few issues raised in the Google Group. \r\n\r\nNot so much an issue from `grape`'s perspective apart from it being the place where this error manifests itself. Definitely something to be aware of when  running `Ruby 1.9+` (commit comment suggests this doesn't affect `Ruby 1.8.x`)\r\n\r\nSo more of an FYI in case anyone else gets bitten by this. \r\n\r\nThe issue is further complicated by the fact that running `rack/test` doesn't cross this codepath. Presumably because temp files are not used in tests??\r\n\r\nThis issue is present in `rack == 1.5.2`, fixed in [`master`](https://github.com/rack/rack/tree/master) as of the time of this post, but not yet released (expected in `1.5.4` I believe)"},"comment":{"url":"https://api.github.com/repos/intridea/grape/issues/comments/68539718","html_url":"https://github.com/intridea/grape/issues/559#issuecomment-68539718","issue_url":"https://api.github.com/repos/intridea/grape/issues/559","id":68539718,"user":{"login":"dblock","id":542335,"avatar_url":"https://avatars.githubusercontent.com/u/542335?v=3","gravatar_id":"","url":"https://api.github.com/users/dblock","html_url":"https://github.com/dblock","followers_url":"https://api.github.com/users/dblock/followers","following_url":"https://api.github.com/users/dblock/following{/other_user}","gists_url":"https://api.github.com/users/dblock/gists{/gist_id}","starred_url":"https://api.github.com/users/dblock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dblock/subscriptions","organizations_url":"https://api.github.com/users/dblock/orgs","repos_url":"https://api.github.com/users/dblock/repos","events_url":"https://api.github.com/users/dblock/events{/privacy}","received_events_url":"https://api.github.com/users/dblock/received_events","type":"User","site_admin":false},"created_at":"2015-01-02T16:33:03Z","updated_at":"2015-01-02T16:33:03Z","body":"Grape doesn't lock to a particular Rack version, so now that Rack 1.6.0 has shipped, this works. I committed the test with https://github.com/intridea/grape/commit/c72181dcb7d32e37dfd7a26084aeb6738cfa58a3."}}