Merge pull request #224 from rolandshoemaker/182-return

Return 500 for multiple certs with same short serial
This commit is contained in:
James 'J.C.' Jones 2015-05-26 15:53:02 -07:00
commit 5d82c5f994
1 changed files with 5 additions and 1 deletions

View File

@ -709,7 +709,11 @@ func (wfe *WebFrontEndImpl) Certificate(response http.ResponseWriter, request *h
cert, err := wfe.SA.GetCertificateByShortSerial(serial)
if err != nil {
wfe.sendError(response, "Not found", err, http.StatusNotFound)
if strings.HasPrefix(err.Error(), "gorp: multiple rows returned") {
wfe.sendError(response, "Multiple certificates with same short serial", err, http.StatusInternalServerError)
} else {
wfe.sendError(response, "Not found", err, http.StatusNotFound)
}
return
}