integration: Fix multiple response.WriteHeader calls

The current integration tests do not return after delegating
HTTP requests, as a result an extra call to response.WriteHeader
is made for every request.

Fix the issue by returning after delegating HTTP requests.
pull/6/head
Kelsey Hightower 2014-07-26 16:09:15 -07:00
parent d102b9c845
commit 7a7dfeb85b
1 changed files with 1 additions and 0 deletions

View File

@ -74,6 +74,7 @@ type delegateHandler struct {
func (h *delegateHandler) ServeHTTP(w http.ResponseWriter, req *http.Request) { func (h *delegateHandler) ServeHTTP(w http.ResponseWriter, req *http.Request) {
if h.delegate != nil { if h.delegate != nil {
h.delegate.ServeHTTP(w, req) h.delegate.ServeHTTP(w, req)
return
} }
w.WriteHeader(http.StatusNotFound) w.WriteHeader(http.StatusNotFound)
} }