Rocket/core/lib/src
Sergio Benitez fbd1a0d069 Improve forwarding status code precision.
Previously, the `NotFound` status code was used to signal many kinds of
recoverable, forwarding errors. This included validation errors, incorrect
Content-Type errors, and more.

This commit modifies the status code used to forward in these instances to more
precisely indicate the forwarding condition. In particular:

  * Parameter `FromParam` errors now forward as 422 (`UnprocessableEntity`).
  * Query paramater errors now forward as 422 (`UnprocessableEntity`).
  * Use of incorrect form content-type forwards as 413 (`UnsupportedMediaType`).
  * `WebSocket` guard now forwards as 400 (`BadRequest`).
  * `&Host`, `&Accept`, `&ContentType`, `IpAddr`, and `SocketAddr` all forward
    with a 500 (`InternalServerError`).

Additionally, the `IntoOutcome` trait was overhauled to support functionality
previously offered by methods on `Outcome`. The `Outcome::forward()` method now
requires a status code to use for the forwarding outcome.

Finally, logging of `Outcome`s now includes the relevant status code.

Resolves #2626.
2023-10-31 18:44:37 -05:00
..
catcher Rename 'Outcome::Failure' to 'Outcome::Error'. 2023-10-31 12:17:28 -05:00
config Rename 'Outcome::Failure' to 'Outcome::Error'. 2023-10-31 12:17:28 -05:00
data Improve forwarding status code precision. 2023-10-31 18:44:37 -05:00
fairing Rename 'Outcome::Failure' to 'Outcome::Error'. 2023-10-31 12:17:28 -05:00
form Improve forwarding status code precision. 2023-10-31 18:44:37 -05:00
fs Improve forwarding status code precision. 2023-10-31 18:44:37 -05:00
local Update 'cookie' to 0.18. 2023-09-28 23:50:29 -07:00
request Improve forwarding status code precision. 2023-10-31 18:44:37 -05:00
response Improve forwarding status code precision. 2023-10-31 18:44:37 -05:00
route Improve forwarding status code precision. 2023-10-31 18:44:37 -05:00
router Expose 'Route', 'Catcher' collision and matching. 2023-04-10 22:00:54 -07:00
serde Rename 'Outcome::Failure' to 'Outcome::Error'. 2023-10-31 12:17:28 -05:00
shield Update 'yansi' to 1.0.0-rc. 2023-07-11 13:18:35 -07:00
cookies.rs Update 'cookie' to 0.18. 2023-09-28 23:50:29 -07:00
error.rs Rename 'Outcome::Failure' to 'Outcome::Error'. 2023-10-31 12:17:28 -05:00
ext.rs Rework TLS listener/connection implementations. 2022-05-03 13:56:25 -07:00
lib.rs Only extract needed values in 'async_main'. 2023-05-18 17:33:57 -07:00
log.rs Update 'yansi' to 1.0.0-rc. 2023-07-11 13:18:35 -07:00
mtls.rs Improve forwarding status code precision. 2023-10-31 18:44:37 -05:00
outcome.rs Improve forwarding status code precision. 2023-10-31 18:44:37 -05:00
phase.rs Update 'state' to 0.6. 2023-05-25 11:54:27 -07:00
rocket.rs Update 'yansi' to 1.0.0-rc. 2023-07-11 13:18:35 -07:00
sentinel.rs Implement more conservative URI normalization. 2023-04-07 19:59:57 -07:00
server.rs Improve forwarding status code precision. 2023-10-31 18:44:37 -05:00
shutdown.rs Protect graceful shutdown against runaway I/O. 2021-05-31 23:47:52 -07:00
state.rs Rename 'Outcome::Failure' to 'Outcome::Error'. 2023-10-31 12:17:28 -05:00
trip_wire.rs Protect graceful shutdown against runaway I/O. 2021-05-31 23:47:52 -07:00