Преглед на файлове

Remove superfluous write header (#3310)

Signed-off-by: Sean Holcomb <seanholcomb@gmail.com>
Sean Holcomb преди 1 година
родител
ревизия
f1295568bf
променени са 1 файла, в които са добавени 0 реда и са изтрити 2 реда
  1. 0 2
      core/pkg/protocol/http.go

+ 0 - 2
core/pkg/protocol/http.go

@@ -121,8 +121,6 @@ func (hp HTTPProtocol) WriteRawNoContent(w http.ResponseWriter) {
 // xss CWE as well as backwards compatibility to exisitng FE expectations
 func (hp HTTPProtocol) WriteJSONData(w http.ResponseWriter, data interface{}) {
 	w.Header().Set("Content-Type", "application/json")
-	status := http.StatusOK
-	w.WriteHeader(status)
 	if err := json.NewEncoder(w).Encode(data); err != nil {
 		log.Error("Failed to encode JSON response: " + err.Error())
 		w.WriteHeader(http.StatusInternalServerError)