Removes the onUnhandledRequest middleware option#740
Merged
wolfy1339 merged 5 commits intooctokit:betafrom Sep 12, 2022
Merged
Conversation
BREAKING CHANGE: middleware only and (always) handles requests at `path`
wolfy1339
approved these changes
Sep 11, 2022
Member
|
Test failures are unrelated to this PR. They should have been caught in #732 |
Contributor
Should we add that to the README? |
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Contributor
Author
|
Thanks! I’ve fixed that. |
74f1421 to
453f55b
Compare
wolfy1339
reviewed
Sep 12, 2022
Contributor
|
🎉 This PR is included in version 11.0.0-beta.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Contributor
|
🎉 This PR is included in version 10.2.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
wolfy1339
pushed a commit
that referenced
this pull request
Oct 3, 2022
* refactor(middleware)!: remove onUnhandledRequest middleware option BREAKING CHANGE: middleware only and (always) handles requests at `path` * build(deps): lock file maintenance (#742) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix(doc): document way to handle unhandled requests * refactor(middleware): remove unused type declarations Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
wolfy1339
pushed a commit
that referenced
this pull request
Oct 3, 2022
* refactor(middleware)!: remove onUnhandledRequest middleware option BREAKING CHANGE: middleware only and (always) handles requests at `path` * fix(doc): document way to handle unhandled requests * refactor(middleware): remove unused type declarations
1 task
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.
expected to be merged into
betabranchWhat?
This PR removes the
onUnhandledRequestmiddleware option.Why?
To respect a proposed general rule that all Octokit middlewares (
oauth-app.js,webhooks.js,app.js):pathPrefix(orpath) option but provide a natural way for concrete runtimes/frameworks to handle unhandled requestspathPrefix(orpath) option (returns404for unknown routes)But my code relies on the
onUnhandledRequestoption!Because
webhook.jsonly exposes a (shared) middleware for Node.js and Express.js middleware currently, the natural way (to handle unhandled requests) is (AFAICT):http.createServer), check returned boolean value:View rendered README.md