Skip to content

Commit

Permalink
integration: Fix multiple response.WriteHeader calls
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
kelseyhightower committed Jul 26, 2014
1 parent d102b9c commit 7a7dfeb
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions cmd/integration/integration.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ type delegateHandler struct {
func (h *delegateHandler) ServeHTTP(w http.ResponseWriter, req *http.Request) {
if h.delegate != nil {
h.delegate.ServeHTTP(w, req)
return
}
w.WriteHeader(http.StatusNotFound)
}
Expand Down

0 comments on commit 7a7dfeb

Please sign in to comment.