Factor out a method for setting common non-HTML (API) headers

Results in setting Content-Disposition: Attachment on text errors,
which was an oversight, since there is no guarantee text passed to
that method is not user-provided.

Change-Id: Ifb5d6991e77075443cb4b4224f7ae028d02a4a1d
1 file changed