Skip to content

Commit

Permalink
Fix invalid JSON in /version endpoint response
Browse files Browse the repository at this point in the history
  • Loading branch information
whatyouhide committed Oct 14, 2023
1 parent 3399ea0 commit a5e164c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion api.go
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ func (server *ApiServer) Version(response http.ResponseWriter, request *http.Req
log := zerolog.Ctx(request.Context())

response.Header().Set("Content-Type", "application/json;charset=utf-8")
version := fmt.Sprintf(`{"version": "%s"}\n`, Version)
version := fmt.Sprintf("{\"version\": \"%s\"}\n", Version)
_, err := response.Write([]byte(version))
if err != nil {
log.Warn().Err(err).Msg("Version: Failed to write response to client")
Expand Down

0 comments on commit a5e164c

Please sign in to comment.