Fix invalid json response

The response was missing quotes around the JSON field names, so it was invalid JSON. This fixes that :)
This commit is contained in:
WimdeJager 2021-06-02 17:21:01 +02:00 committed by GitHub
parent f1b9ac1027
commit 0c9e1d2e22
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -113,7 +113,7 @@ func scanHandler(w http.ResponseWriter, r *http.Request) {
response, err := c.ScanStream(part, abort)
for s := range response {
w.Header().Set("Content-Type", "application/json; charset=utf-8")
respJson := fmt.Sprintf("{ Status: \"%s\", Description: \"%s\" }", s.Status, s.Description)
respJson := fmt.Sprintf("{ \"Status\": \"%s\", \"Description\": \"%s\" }", s.Status, s.Description)
switch s.Status {
case clamd.RES_OK:
w.WriteHeader(http.StatusOK)