Use buffer with template.Execute
Use buffer with template.Execute

Instead of writing directly to the http.ResponseWriter, use a buffer and
write to the http.ResponseWriter only in the case of success. This is to
avoid partially writing to the http.ResponseWriter, encountering an
error, and then cause multiple WriteHeader calls when trying to handle
the error.

pivotal-cf/cred-alert,pivotal-cf/cred-alert