GeezerVison is showing github.com — Add `rack.response_finished` to `Rack::Lint`. by ioquatix · Pull Request #1952 · rack/rack
Conversation
ioquatix
commented
Aug 26, 2022
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
This updates Rack::Lint to validate that rack.response_finished is an
array of callables when present in the env. e.g. procs, lambdas, or
objects that respond to call.
This validates that:
rack.response_finished is an array
- The contents of the array all respond to
call
And specifies that:
- The callback will receive
(env, status, headers, error) as arguments.
Bringing #1802 to completion according to @tenderlove's recommendations/requirements.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
ioquatix
changed the title
Add rack.response_finished to Rack::Lint
Add rack.response_finished to Rack::Lint.
Aug 26, 2022
This updates Rack::Lint to validate that `rack.response_finished` is an
array of callables when present in the `env`. e.g. procs, lambdas, or
objects that respond to `call`.
This validates that:
* `rack.response_finished` is an array
* The contents of the array all respond to `call`
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.
This doesn't check that if rack.response_finished is present, each entry in the array, if called, is called with the four arguments. I'm not sure whether it is not worth wrapping each callable in the array in a wrapper that does such checks, but we do take similar steps in other cases (e.g. InputWrapper, ErrorWrapper, StreamWrapper).
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
ioquatix and Fulya2133 reacted with thumbs up emoji
Fulya2133 reacted with rocket emoji
All reactions
-
👍
2 reactions
-
🚀
1 reaction
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Aug 26, 2022
casperisfine
pushed a commit
to Shopify/pitchfork
that referenced
this pull request
Mar 11, 2024
Fix: #97
Ref: rack/rack#1952
Similar to `rack.after_reply` but this one is part of the Rack
spec and expect some arguments.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|