From 2a889e7f79ffee32792ef60ed7089d13c4189568 Mon Sep 17 00:00:00 2001 From: Martin Buhr Date: Fri, 10 Jul 2015 06:49:06 -0400 Subject: [PATCH] Fixes #58 --- middleware_auth_key.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/middleware_auth_key.go b/middleware_auth_key.go index 46b63558466..4b5d1246208 100644 --- a/middleware_auth_key.go +++ b/middleware_auth_key.go @@ -38,7 +38,7 @@ func (k *AuthKey) ProcessRequest(w http.ResponseWriter, r *http.Request, configu defer r.Body.Close() - // Buffer body data + // Buffer body data - don't like thi but we would otherwise drain the request body var bodyBuffer bytes.Buffer bodyBuffer2 := new(bytes.Buffer) @@ -48,6 +48,8 @@ func (k *AuthKey) ProcessRequest(w http.ResponseWriter, r *http.Request, configu // Create new ReadClosers so we can split output r.Body = ioutil.NopCloser(&bodyBuffer) tempRes.Body = ioutil.NopCloser(bodyBuffer2) + + // Set hte header name authHeaderValue = tempRes.FormValue(thisConfig.AuthHeaderName) }