From 3d22a4e6858537e18fb847b452252aef6797b31c Mon Sep 17 00:00:00 2001 From: Muslim AbuTaha Date: Thu, 2 Feb 2017 12:53:32 +0200 Subject: [PATCH] Make it work with Amazon ES 5.1 and Kibana 5.1.1 --- aws-es-proxy.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/aws-es-proxy.go b/aws-es-proxy.go index c7bfd328..44b4f33b 100644 --- a/aws-es-proxy.go +++ b/aws-es-proxy.go @@ -101,6 +101,11 @@ func (p *proxy) ServeHTTP(w http.ResponseWriter, r *http.Request) { return } + // Workaround for ES 5.1 and Kibana 5.1.1 + if val, ok := r.Header["Kbn-Version"]; ok { + req.Header.Set("Kbn-Version", val[0]) + } + // Sign the request with AWSv4 payload := bytes.NewReader(replaceBody(req)) p.Signer.Sign(req, payload, p.Service, p.Region, time.Now())