Skip to content

Commit 8e9265c

Browse files
vszakatszeripath
authored andcommitted
webhook: set Content-Type for application/x-www-form-urlencoded (#8600)
This header is missing since switching http client from GiteaServer (`code.gitea.io/gitea/modules/httplib`) to Go-http-client/1.1 (`net.http`). The header [was added by default](https://github.com/go-gitea/gitea/blob/release/v1.8/modules/httplib/httplib.go#L301) by the former, but this is no longer true with `net.http`, so it needs to be done explicitly. Closes: #7700
1 parent 435ce92 commit 8e9265c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

models/webhook.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -833,6 +833,8 @@ func (t *HookTask) deliver() error {
833833

834834
return err
835835
}
836+
837+
req.Header.Set("Content-Type", "application/x-www-form-urlencoded")
836838
}
837839
case http.MethodGet:
838840
u, err := url.Parse(t.URL)

0 commit comments

Comments
 (0)