Set the Certificate Content-Type before writing headers. (#3304)

Prior to this commit we called `response.WriteHeader(http.StatusOK)` in
the wfe2's `Certificate` handler before
`response.Header().Set("Content-Type", "")`, which meant that the
response was served with a Content-Type of `application/json` instead of
the intended `application/pem-certificate-chain`. This commit changes
the order so the correct Content-Type header is written in the response.
This commit is contained in:
Daniel McCarney 2017-12-21 17:02:30 -05:00 committed by Roland Bracewell Shoemaker
parent 488b7259ae
commit aa62a90303
1 changed files with 1 additions and 1 deletions

View File

@ -1207,8 +1207,8 @@ func (wfe *WebFrontEndImpl) Certificate(ctx context.Context, logEvent *web.Reque
return
}
response.WriteHeader(http.StatusOK)
response.Header().Set("Content-Type", "application/pem-certificate-chain")
response.WriteHeader(http.StatusOK)
pem := pem.EncodeToMemory(&pem.Block{
Type: "CERTIFICATE",