-
Notifications
You must be signed in to change notification settings - Fork 116
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix parameter reporting for Rack and Sinatra apps
The AbstractMiddleware tried to set the request parameters before the app handled the request. This could cause the request object to end up in a weird state where, if some other middleware (like a JSON payload parsing middleware) hadn't parsed the request payload yet, the parameters were reported as empty. Move the parameter setting to the "after" hook so that it doesn't try to read the parameters before they're parsed. Use the new `Transaction#set_params_if_nil` so that it doesn't overwrite any custom parameters set by the app. Fixes #1108
- Loading branch information
Showing
3 changed files
with
7 additions
and
4 deletions.
There are no files selected for viewing
6 changes: 6 additions & 0 deletions
6
.changesets/fix-parameter-reporting-for-rack-and-sinatra-apps.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
bump: patch | ||
type: fix | ||
--- | ||
|
||
Fix parameter reporting for Rack and Sinatra apps, especially POST payloads. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters