fix: improve handling of nil imaging settings and adjust SOAP fault response status codes

This commit is contained in:
ProtoTess
2025-12-01 03:02:46 +00:00
parent b7292bb6cd
commit df7d476e14
4 changed files with 18 additions and 47 deletions
+6 -2
View File
@@ -204,9 +204,13 @@ func (h *Handler) sendFault(w http.ResponseWriter, code, reason, detail string)
// Add XML declaration
xmlBody := append([]byte(xml.Header), body...)
// Send fault response
// Send fault response - use appropriate status code based on fault code
w.Header().Set("Content-Type", "application/soap+xml; charset=utf-8")
w.WriteHeader(http.StatusInternalServerError)
statusCode := http.StatusInternalServerError
if code == "Sender" {
statusCode = http.StatusBadRequest
}
w.WriteHeader(statusCode)
_, _ = w.Write(xmlBody)
}