Move the Host extractor to axum-extra (#2956)

This commit is contained in:
Jonas Platte
2024-10-14 22:45:37 +00:00
committed by GitHub
parent 24d24f4ccb
commit 0ddc63f77e
10 changed files with 38 additions and 29 deletions
+23
View File
@@ -0,0 +1,23 @@
//! Rejection response types.
use axum_core::{
__composite_rejection as composite_rejection, __define_rejection as define_rejection,
};
define_rejection! {
#[status = BAD_REQUEST]
#[body = "No host found in request"]
/// Rejection type used if the [`Host`](super::Host) extractor is unable to
/// resolve a host.
pub struct FailedToResolveHost;
}
composite_rejection! {
/// Rejection used for [`Host`](super::Host).
///
/// Contains one variant for each way the [`Host`](super::Host) extractor
/// can fail.
pub enum HostRejection {
FailedToResolveHost,
}
}