Skip to content

Commit 482a79d

Browse files
simonpasquiermattbostock
authored andcommitted
Add Content-Type header to HTTP requests
Elasticsearch 6.0 and above enforces the presence of the Content-Type header in all incoming requests [1]. [1] http://bit.ly/2GaOVX9
1 parent 162379f commit 482a79d

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

main.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ func handler(w http.ResponseWriter, r *http.Request) {
155155
}
156156

157157
req.Header.Set("User-Agent", versionString)
158+
req.Header.Set("Content-Type", "application/json")
158159

159160
resp, err := http.DefaultClient.Do(req)
160161
if err != nil {

0 commit comments

Comments
 (0)