瀏覽代碼

Fix extra write header.

Mariano Cano 7 年之前
父節點
當前提交
4f08a7816f
共有 2 個文件被更改,包括 4 次插入 和 6 次删除
  1. 2 3
      api/sshRekey.go
  2. 2 3
      api/sshRenew.go

+ 2 - 3
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)
 }

+ 2 - 3
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)
 }