Commit c66c615
committed
[bitreq] Check utf-8 while deserializing JSON body
While deserializing, `serde_json::from_slice` validates utf-8 as
needed. So instead of making two passes on the response body, one
to validate utf-8, and another to deserialize the object, we can
let `serde_json::from_slice` check utf-8 as needed during
deserialization.
`Response::json` now returns `Error::SerdeJsonError` instead of
`Error::InvalidUtf8InBody` if invalid utf-8 bytes are found during
deserialization.1 parent d31fc06 commit c66c615
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
248 | 248 | | |
249 | 249 | | |
250 | 250 | | |
251 | | - | |
| 251 | + | |
252 | 252 | | |
253 | 253 | | |
254 | 254 | | |
| |||
0 commit comments