mirror of
https://github.com/go-gitea/gitea
synced 2024-12-22 07:37:51 +01:00
webhook: set Content-Type for application/x-www-form-urlencoded (#8599)
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: Ref: https://github.com/go-gitea/gitea/issues/7700
This commit is contained in:
parent
3b379691fa
commit
bcd96421dd
@ -833,6 +833,8 @@ func (t *HookTask) deliver() error {
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
req.Header.Set("Content-Type", "application/x-www-form-urlencoded")
|
||||
}
|
||||
case http.MethodGet:
|
||||
u, err := url.Parse(t.URL)
|
||||
|
Loading…
Reference in New Issue
Block a user