From 864dd3cf1fab06901a23c98c2b34fe4eed68b662 Mon Sep 17 00:00:00 2001 From: Mariano Cano Date: Thu, 21 Nov 2019 19:06:19 -0800 Subject: [PATCH] Fix extra write header. --- api/sshRekey.go | 5 ++--- api/sshRenew.go | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/api/sshRekey.go b/api/sshRekey.go index 530b9df3..234a6df5 100644 --- a/api/sshRekey.go +++ b/api/sshRekey.go @@ -71,8 +71,7 @@ func (h *caHandler) SSHRekey(w http.ResponseWriter, r *http.Request) { return } - w.WriteHeader(http.StatusCreated) - JSON(w, &SSHSignResponse{ + JSONStatus(w, &SSHSignResponse{ Certificate: SSHCertificate{newCert}, - }) + }, http.StatusCreated) } diff --git a/api/sshRenew.go b/api/sshRenew.go index 3aea01bb..4324ebba 100644 --- a/api/sshRenew.go +++ b/api/sshRenew.go @@ -61,8 +61,7 @@ func (h *caHandler) SSHRenew(w http.ResponseWriter, r *http.Request) { return } - w.WriteHeader(http.StatusCreated) - JSON(w, &SSHSignResponse{ + JSONStatus(w, &SSHSignResponse{ Certificate: SSHCertificate{newCert}, - }) + }, http.StatusCreated) }