-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Less query params parsing #2553
base: master
Are you sure you want to change the base?
Conversation
Add some rescues when dealing with rack_params and GET functions Add exceptions related to rescues
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nicely done. Only nits from me. Consider adding the removal of CONSTANTs into UPGRADING.
a8c6300
to
a872545
Compare
a872545
to
e358a4f
Compare
@@ -1,6 +1,11 @@ | |||
Upgrading Grape | |||
=============== | |||
|
|||
### Grape::Middleware::Base |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For later, we should have an Upgrading >= X.Y.Z
here whatever the next version is.
Coveralls is down for maintenance, let's wait for it to come back. |
This PRs reduces potential query params parsing. Instead of calling
Rack::Utils.parse_nested_query(env[Rack::QUERY_STRING])
directly, Grape will call Rack's function GET that does the same work but keeps the parsed version inRACK_REQUEST_QUERY_HASH
. This way, parsing will be done at most once.Also, it fixes #2488 and it comes with a tiny refactor in
Grape::Middleware::Formatter
including comments in the code. Finally, this PR adds a new function namedrack_request
that's create a instance ofRack::Request
fromenv
inGrape::Middleware::Base
.Grape::Middleware::Formatter
had already the equivalent but namedrequest
. This helps for callingGET
in middlewares and I think user might benefit from it.