Skip to content

Commit

Permalink
Merge branch 'saravanan30erd-issue-70'
Browse files Browse the repository at this point in the history
  • Loading branch information
abutaha committed Jun 5, 2020
2 parents 4306126 + e530c28 commit 643e6f4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion aws-es-proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,8 @@ func (p *proxy) ServeHTTP(w http.ResponseWriter, r *http.Request) {
}

// Recent versions of ES/Kibana require
// "kbn-version" and "content-type: application/json"
// "content-type: application/json" and
// either "kbn-version" or "kbn-xsrf"
// headers to exist in the request.
// If missing requests fails.
func addHeaders(src, dest http.Header) {
Expand All @@ -383,6 +384,10 @@ func addHeaders(src, dest http.Header) {
if val, ok := src["Content-Type"]; ok {
dest.Add("Content-Type", val[0])
}

if val, ok := src["Kbn-Xsrf"]; ok {
dest.Add("Kbn-Xsrf", val[0])
}
}

// Signer.Sign requires a "seekable" body to sum body's sha256
Expand Down

0 comments on commit 643e6f4

Please sign in to comment.