Skip to content

Commit

Permalink
Remove route_info from params (Close #789)
Browse files Browse the repository at this point in the history
  • Loading branch information
rodzyn committed Jan 8, 2015
1 parent 811eca6 commit 630ac87
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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

2 comments on commit 630ac87

@elado
Copy link
Contributor

@elado elado commented on 630ac87 Jan 8, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why even set it if it's being deleted? If it's used in another place, env['grape.route_info'] could hold it.

@dblock
Copy link
Member

@dblock dblock commented on 630ac87 Jan 9, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@elado Want to try and do that? It doesn't look that simple :)

Please sign in to comment.