Commit 0e3e563
committed
http: allow empty request bodies in JSON parsing
The JSON decoder returns io.EOF when the request body is empty, which
was previously treated as an error. This prevented API endpoints with
optional request bodies from succeeding when called without a body.
Treat io.EOF as an empty object to support endpoints like DELETE
/sys/rekey/init that accept either a body with parameters or no body
at all.
Signed-off-by: Tero Saarni <[email protected]>1 parent 46b1821 commit 0e3e563
2 files changed
+7
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
896 | 896 | | |
897 | 897 | | |
898 | 898 | | |
899 | | - | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
900 | 903 | | |
901 | 904 | | |
902 | 905 | | |
| |||
0 commit comments