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:
parent
f1b9ac1027
commit
0c9e1d2e22
1 changed files with 1 additions and 1 deletions
|
@ -113,7 +113,7 @@ func scanHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
response, err := c.ScanStream(part, abort)
|
response, err := c.ScanStream(part, abort)
|
||||||
for s := range response {
|
for s := range response {
|
||||||
w.Header().Set("Content-Type", "application/json; charset=utf-8")
|
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 {
|
switch s.Status {
|
||||||
case clamd.RES_OK:
|
case clamd.RES_OK:
|
||||||
w.WriteHeader(http.StatusOK)
|
w.WriteHeader(http.StatusOK)
|
||||||
|
|
Loading…
Add table
Reference in a new issue