Add rack.response_finished to Rack::Lint.#1952
Merged
Conversation
rack.response_finished to Rack::Lint.
137f5a8 to
aa81c86
Compare
6672eb2 to
9c88c6a
Compare
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`
9c88c6a to
d804915
Compare
jeremyevans
reviewed
Aug 26, 2022
Contributor
jeremyevans
left a comment
There was a problem hiding this comment.
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).
tenderlove
approved these changes
Aug 26, 2022
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.
7 tasks
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This updates Rack::Lint to validate that
rack.response_finishedis anarray of callables when present in the
env. e.g. procs, lambdas, orobjects that respond to
call.This validates that:
rack.response_finishedis an arraycallAnd specifies that:
(env, status, headers, error)as arguments.Bringing #1802 to completion according to @tenderlove's recommendations/requirements.