Skip to content

Commit

Permalink
Fix #559: Rack 1.6.0 properly parses requests larger than 128KB.
Browse files Browse the repository at this point in the history
  • Loading branch information
myitcv authored and dblock committed Jan 2, 2015
1 parent a83043f commit c72181d
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ Next Release
============

* [#871](https://github.com/intridea/grape/pull/871): Fixed Grape::Middleware::Base#response - [@galathius](https://github.com/galathius).
* [#559](https://github.com/intridea/grape/issues/559): Support Rack 1.6.0 to parse requests larger than 128KB - [@myitcv](https://github.com/myitcv).
* Your contribution here.

0.10.1 (12/28/2014)
Expand Down
10 changes: 10 additions & 0 deletions UPGRADING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
Upgrading Grape
===============

### Upgrading to >= 0.10.2

Grape now supports, but doesn't require Rack 1.6.0. If you encounter an issue with parsing requests larger than 128KB, explictly require Rack 1.6.0 in your Gemfile.

```ruby
gem 'rack', '~> 1.6.0'
```

See [#559](https://github.com/intridea/grape/issues/559) for more information.

### Upgrading to >= 0.10.1

#### Changes to `declared(params, include_missing: false)`
Expand Down
26 changes: 26 additions & 0 deletions spec/grape/integration/rack_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
require 'spec_helper'

describe Rack do
it 'correctly populates params from a Tempfile' do
input = Tempfile.new 'rubbish'
begin
app = Class.new(Grape::API) do
format :json
post do
{ params_keys: params.keys }
end
end
input.write({ test: '123' * 10_000 }.to_json)
input.rewind
options = {
input: input,
method: 'POST',
'CONTENT_TYPE' => 'application/json'
}
env = Rack::MockRequest.env_for('/', options)
expect(JSON.parse(app.call(env)[2].body.first)['params_keys']).to match_array(%w(route_info test))
ensure
input.unlink
end
end
end

0 comments on commit c72181d

Please sign in to comment.