If WriteHeader is called multiple times on a http.ResponseWriter, the first status is the one that is used, not the last. Fix the wrapped writer to reflect this fact.