Skip to content

Commit d0615dd

Browse files
committed
1 parent 4564fbd commit d0615dd

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

routers/web/repo/setting/webhook.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -551,6 +551,7 @@ func wechatworkHookParams(ctx *context.Context) webhookParams {
551551
Type: webhook_module.WECHATWORK,
552552
URL: form.PayloadURL,
553553
ContentType: webhook.ContentTypeJSON,
554+
HTTPMethod: http.MethodPost,
554555
WebhookForm: form.WebhookForm,
555556
}
556557
}

services/webhook/payloader.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,12 @@ func newJSONRequest[T any](pc payloadConvertor[T], w *webhook_model.Webhook, t *
9494
return nil, nil, err
9595
}
9696

97-
req, err := http.NewRequest(w.HTTPMethod, w.URL, bytes.NewReader(body))
97+
method := w.HTTPMethod
98+
if method == "" {
99+
method = http.MethodPost
100+
}
101+
102+
req, err := http.NewRequest(method, w.URL, bytes.NewReader(body))
98103
if err != nil {
99104
return nil, nil, err
100105
}

0 commit comments

Comments
 (0)