Skip to content

Commit

Permalink
webhook: set Content-Type for application/x-www-form-urlencoded (#8599)
Browse files Browse the repository at this point in the history
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: #7700
  • Loading branch information
vszakats authored and techknowlogick committed Oct 20, 2019
1 parent 3b37969 commit bcd9642
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions models/webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit bcd9642

Please sign in to comment.