Explorar o código

Fix extra write header.

Mariano Cano %!s(int64=7) %!d(string=hai) anos
pai
achega
864dd3cf1f
Modificáronse 2 ficheiros con 4 adicións e 6 borrados
  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
 		return
 	}
 	}
 
 
-	w.WriteHeader(http.StatusCreated)
-	JSON(w, &SSHSignResponse{
+	JSONStatus(w, &SSHSignResponse{
 		Certificate: SSHCertificate{newCert},
 		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
 		return
 	}
 	}
 
 
-	w.WriteHeader(http.StatusCreated)
-	JSON(w, &SSHSignResponse{
+	JSONStatus(w, &SSHSignResponse{
 		Certificate: SSHCertificate{newCert},
 		Certificate: SSHCertificate{newCert},
-	})
+	}, http.StatusCreated)
 }
 }