Update status code for form processing failure.

This commit is contained in:
Garrett Squire 2017-01-03 12:06:22 -08:00 committed by Sergio Benitez
parent ed429cd487
commit 11e90f525f
2 changed files with 3 additions and 1 deletions

View File

@ -40,6 +40,6 @@ fn test_bad_login() {
#[test] #[test]
fn test_bad_form() { fn test_bad_form() {
// Mess with the form formatting. // Mess with the form formatting.
test_login("Sergio&other=blah&", "password", 0, Status::BadRequest, None); test_login("Sergio&other=blah", "password", 0, Status::UnprocessableEntity, None);
test_login("&&&===&", "password", 0, Status::BadRequest, None); test_login("&&&===&", "password", 0, Status::BadRequest, None);
} }

View File

@ -219,6 +219,8 @@ pub mod defaults {
teapot.", handle_418, teapot.", handle_418,
421, "Misdirected Request", "The server cannot produce a response for this 421, "Misdirected Request", "The server cannot produce a response for this
request.", handle_421, request.", handle_421,
422, "Unprocessable Entity", "The request was well-formed but was unable to
be followed due to semantic errors.", handle_422,
426, "Upgrade Required", "Switching to the protocol in the Upgrade header 426, "Upgrade Required", "Switching to the protocol in the Upgrade header
field is required.", handle_426, field is required.", handle_426,
428, "Precondition Required", "The server requires the request to be 428, "Precondition Required", "The server requires the request to be