Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions routers/web/repo/setting/webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -551,6 +551,7 @@ func wechatworkHookParams(ctx *context.Context) webhookParams {
Type: webhook_module.WECHATWORK,
URL: form.PayloadURL,
ContentType: webhook.ContentTypeJSON,
HTTPMethod: http.MethodPost,
WebhookForm: form.WebhookForm,
}
}
Expand Down
7 changes: 6 additions & 1 deletion services/webhook/payloader.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,12 @@ func newJSONRequest[T any](pc payloadConvertor[T], w *webhook_model.Webhook, t *
return nil, nil, err
}

req, err := http.NewRequest(w.HTTPMethod, w.URL, bytes.NewReader(body))
method := w.HTTPMethod
if method == "" {
method = http.MethodPost
}

req, err := http.NewRequest(method, w.URL, bytes.NewReader(body))
if err != nil {
return nil, nil, err
}
Expand Down