Details
-
Bug
-
Resolution: Fixed
-
Critical
-
2.7.0
-
Security Level: Public
-
None
-
CBG Sprint 75
-
3
Description
Need to ensure strings are correctly escaped when manually building JSON responses (we do this for some small efficiency reasons). We already do this in some places via ConvertToJSONString, need to make sure this is used comprehensively.
Same general issue as CBG-661, but that fix was too narrow.
E.g:
from handler.writeRawJSON, handler.writeRawJSONStatus
h.writeRawJSON([]byte(`{"id":"` + docid + `","ok":true,"rev":"` + newRev + `"}`)) |
h.writeRawJSONStatus(http.StatusCreated, []byte(`{"id":"`+docid+`","ok":true,"rev":"`+newRev+`"}`)) |
Attachments
Issue Links
- relates to
-
CBG-661 Errors from REST API produce invalid JSON
- Resolved