Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
lonelycode committed Jul 10, 2015
1 parent 0c21d29 commit 2a889e7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion middleware_auth_key.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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)
}

Expand Down

0 comments on commit 2a889e7

Please sign in to comment.