- The version of Rocket you're using. Ensure it's the latest, if possible.
0.3.6
- The operating system (distribution and version) where the issue occurs.
Mac OS X Sierra 10.12.6 (16G1212)
- A brief description of the bug that includes:
Connection is immediately closed if JSON being deserialized returns an error. The following log messages I think explain it well:
WARN rocket::data::data_stream > Data left unread. Force closing network stream.
ERROR rocket_contrib::json > Couldn't parse JSON body: ErrorImpl { code: Message("missing field `url`"), line: 1, column: 3244 }
INFO rocket::rocket > Outcome: Failure
WARN rocket::rocket > Responding with 400 Bad Request catcher.
ERROR rocket::rocket > Failed to write response: Error { repr: Os { code: 32, message: "Broken pipe" } }.
INFO hyper::server > set_read_timeout keep_alive Error { repr: Os { code: 22, message: "Invalid argument" } }
Client submits JSON request which fails to deserialize in rocket_contrib-0.3.6/src/json.rs:101
- What you expected vs. what actually happened.
I expected 400 error to be returned. What I get is client receiving no response (connection is closed).
- How you uncovered the bug. Short, reproducible tests are especially useful.
Accidentally. Don't have test case at the moment.
- Ideas, if any, about what Rocket is doing incorrectly.
I think, Rocket should skip the remaining data when deserialization fails.
0.3.6
Mac OS X Sierra 10.12.6 (16G1212)
Connection is immediately closed if JSON being deserialized returns an error. The following log messages I think explain it well:
Client submits JSON request which fails to deserialize in
rocket_contrib-0.3.6/src/json.rs:101I expected 400 error to be returned. What I get is client receiving no response (connection is closed).
Accidentally. Don't have test case at the moment.
I think, Rocket should skip the remaining data when deserialization fails.