mirror of
https://github.com/tokio-rs/axum.git
synced 2024-12-28 23:38:20 +01:00
parent
f12ab072c5
commit
0d05b5e31f
5 changed files with 4 additions and 27 deletions
|
@ -54,7 +54,7 @@ macro_rules! composite_rejection {
|
|||
#[non_exhaustive]
|
||||
pub enum $name {
|
||||
$(
|
||||
#[allow(missing_docs, deprecated)]
|
||||
#[allow(missing_docs)]
|
||||
$variant($variant)
|
||||
),+
|
||||
}
|
||||
|
@ -70,7 +70,6 @@ macro_rules! composite_rejection {
|
|||
}
|
||||
|
||||
$(
|
||||
#[allow(deprecated)]
|
||||
impl From<$variant> for $name {
|
||||
fn from(inner: $variant) -> Self {
|
||||
Self::$variant(inner)
|
||||
|
|
|
@ -54,6 +54,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
- `PathRejection`
|
||||
- `MatchedPathRejection`
|
||||
- `WebSocketUpgradeRejection`
|
||||
- **breaking:** `Redirect::found` has been removed ([#800])
|
||||
- **fixed:** Set `Allow` header when responding with `405 Method Not Allowed` ([#733])
|
||||
- **fixed:** Correctly set the `Content-Length` header for response to `HEAD`
|
||||
requests ([#734])
|
||||
|
@ -72,6 +73,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
[#783]: https://github.com/tokio-rs/axum/pull/783
|
||||
[#791]: https://github.com/tokio-rs/axum/pull/791
|
||||
[#797]: https://github.com/tokio-rs/axum/pull/797
|
||||
[#800]: https://github.com/tokio-rs/axum/pull/800
|
||||
|
||||
# 0.4.4 (13. January, 2022)
|
||||
|
||||
|
|
|
@ -20,7 +20,6 @@ mod request_parts;
|
|||
pub use axum_core::extract::{FromRequest, RequestParts};
|
||||
|
||||
#[doc(inline)]
|
||||
#[allow(deprecated)]
|
||||
pub use self::{
|
||||
connect_info::ConnectInfo,
|
||||
content_length_limit::ContentLengthLimit,
|
||||
|
|
|
@ -57,7 +57,6 @@ macro_rules! define_rejection {
|
|||
#[non_exhaustive]
|
||||
pub struct $name;
|
||||
|
||||
#[allow(deprecated)]
|
||||
impl $crate::response::IntoResponse for $name {
|
||||
fn into_response(self) -> $crate::response::Response {
|
||||
(http::StatusCode::$status, $body).into_response()
|
||||
|
@ -134,7 +133,7 @@ macro_rules! composite_rejection {
|
|||
#[non_exhaustive]
|
||||
pub enum $name {
|
||||
$(
|
||||
#[allow(missing_docs, deprecated)]
|
||||
#[allow(missing_docs)]
|
||||
$variant($variant)
|
||||
),+
|
||||
}
|
||||
|
@ -150,7 +149,6 @@ macro_rules! composite_rejection {
|
|||
}
|
||||
|
||||
$(
|
||||
#[allow(deprecated)]
|
||||
impl From<$variant> for $name {
|
||||
fn from(inner: $variant) -> Self {
|
||||
Self::$variant(inner)
|
||||
|
|
|
@ -69,27 +69,6 @@ impl Redirect {
|
|||
Self::with_status_code(StatusCode::PERMANENT_REDIRECT, uri)
|
||||
}
|
||||
|
||||
/// Create a new [`Redirect`] that uses a [`302 Found`][mdn] status code.
|
||||
///
|
||||
/// This is the same as [`Redirect::temporary`] ([`307 Temporary Redirect`][mdn307]) except
|
||||
/// this status code is older and thus supported by some legacy clients that don't understand
|
||||
/// the newer one. Many clients wrongly apply [`Redirect::to`] ([`303 See Other`][mdn303])
|
||||
/// semantics for this status code, so it should be avoided where possible.
|
||||
///
|
||||
/// # Panics
|
||||
///
|
||||
/// If `uri` isn't a valid [`HeaderValue`].
|
||||
///
|
||||
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/302
|
||||
/// [mdn307]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/307
|
||||
/// [mdn303]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/303
|
||||
#[deprecated(
|
||||
note = "This results in different behavior between clients, so Redirect::temporary or Redirect::to should be used instead"
|
||||
)]
|
||||
pub fn found(uri: Uri) -> Self {
|
||||
Self::with_status_code(StatusCode::FOUND, uri)
|
||||
}
|
||||
|
||||
// This is intentionally not public since other kinds of redirects might not
|
||||
// use the `Location` header, namely `304 Not Modified`.
|
||||
//
|
||||
|
|
Loading…
Reference in a new issue