-
Notifications
You must be signed in to change notification settings - Fork 80
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
[BUG]: Express middleware aborts on non-POST requests in v11 #844
Comments
It's been a while since I have used Probot, but I was under the impression that the other HTTP paths and Webhooks paths were different. It is intentional that we don't handle That change was introduced in #740 |
@baoshan Could you help us understand why the change was made? |
Because:
These rules make such middleware more predictable and simplify the implementation. It seems Is there some room in I am flexible and am willing to loose the second rule from |
It would require a breaking change in Probot, or removing the default page. The default page gave users some information about how to proceed, so I would not like to remove it. If the /path changed, every developer would have to go to GitHub to change their settings when updating probot, which would also be annoying. |
I don’t use Probot. If it is an express.js app, can the handler for the default page be placed before |
Yes it might be annoying, but it's the case with any breaking change.
There's a middleware exported, like in this repo, and an |
Can both the express.js app and the middleware render the default page before delegating a request to |
Probot currently also allow users to overwrite I'm not sure whether @gr2m is still maintaining Octokit (He's not a member of the org), but I'd also like to get his feedback on this. In my opinion, moving the webhooks path would be the best option for Probot long-term, even if it is annoying. |
I still think there may be a 4th one: Probot renders the default page ( It may depend on how Probot allows users to overwrite Please correct me if that’s impossible. |
It allows it by giving access to express directly, which always happens after the middleware is loaded. Maybe this can be changed though, I'll experiment with it a bit. Thanks for the suggestions! |
In general I agree that we should move the path to receive webhooks in Probot from |
Having it on |
What happened?
After migrating to v11, non-post requests on the webhooksPath lead to an error. For v10 and below, next() was called instead.
This causes issues with Probot, which listens on / for webhooks, but also displays a web page on GET requests.
I'm not sure if this is intentional, but if it is, then please make this behaviour configurable.
Versions
@octokit/webhooks
v11Relevant log output
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: