Skip to content

Commit

Permalink
Merge pull request #879 from rodzyn/route_info
Browse files Browse the repository at this point in the history
Remove route_info from params (Close #789)
  • Loading branch information
dblock committed Jan 8, 2015
2 parents e9de222 + 630ac87 commit 3eea554
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -4,6 +4,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).
* [#876](https://github.com/intridea/grape/pull/876): declared(params) now returning Hashie::Mash - [@rodzyn](https://github.com/rodzyn).
* [#879](https://github.com/intridea/grape/pull/879): route_info is not included in params Hash anymore - [@rodzyn](https://github.com/rodzyn).
* Your contribution here.

0.10.1 (12/28/2014)
Expand Down
8 changes: 8 additions & 0 deletions UPGRADING.md
Expand Up @@ -3,6 +3,8 @@ Upgrading Grape

### Upgrading to >= 0.10.2

#### Added Rack 1.6.0 Support

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
Expand All @@ -11,6 +13,12 @@ gem 'rack', '~> 1.6.0'

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

#### Removed route_info

Key route_info is excluded from params.

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

### Upgrading to >= 0.10.1

#### Changes to `declared(params, include_missing: false)`
Expand Down
1 change: 1 addition & 0 deletions lib/grape/http/request.rb
Expand Up @@ -7,6 +7,7 @@ def params
args = env['rack.routing_args'].dup
# preserve version from query string parameters
args.delete(:version)
args.delete(:route_info)
params.deep_merge!(args)
end
params
Expand Down
2 changes: 1 addition & 1 deletion spec/grape/integration/rack_spec.rb
Expand Up @@ -23,7 +23,7 @@
# can't check explicitly version of Rack because of https://github.com/rack/rack/issues/773
pending 'Rack 1.6.0 is required' unless ::Rack.const_defined?(:TempfileReaper) || RUBY_PLATFORM == 'java'

expect(JSON.parse(app.call(env)[2].body.first)['params_keys']).to match_array(%w(route_info test))
expect(JSON.parse(app.call(env)[2].body.first)['params_keys']).to match_array('test')
ensure
input.close
input.unlink
Expand Down

0 comments on commit 3eea554

Please sign in to comment.