-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Webhook Logs show proper HTTP Method, and allow change HTTP method in form #6953
Conversation
@@ -98,6 +98,7 @@ func addHook(ctx *context.APIContext, form *api.CreateHookOption, orgID, repoID | |||
URL: form.Config["url"], | |||
ContentType: models.ToHookContentType(form.Config["content_type"]), | |||
Secret: form.Config["secret"], | |||
HTTPMethod: "POST", |
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.
Note: I've hardcoded this as POST
for now. Currently there are several checks that essentially force POST to be the method, but I want to keep this PR as simple as possible. This of course will need to be changed in future.
@@ -755,28 +755,23 @@ func prepareWebhooks(e Engine, repo *Repository, event HookEventType, p api.Payl | |||
|
|||
func (t *HookTask) deliver() { | |||
t.IsDelivered = true | |||
t.RequestInfo = &HookRequest{ |
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.
I've moving these back to the original spot before the GET
PR was merged.
Codecov Report
@@ Coverage Diff @@
## master #6953 +/- ##
=========================================
+ Coverage 41.4% 41.4% +<.01%
=========================================
Files 441 441
Lines 59718 59724 +6
=========================================
+ Hits 24728 24731 +3
- Misses 31753 31756 +3
Partials 3237 3237
Continue to review full report at Codecov.
|
… form (go-gitea#6953) * Fix go-gitea#6951 - logs show proper HTTP Method, and allow change HTTP method in form * enforce POST method for webhook * set default if method is empty
Fix #6951
Note: this doesn't solve issues some users were having with webhooks not sending.