mirror of
https://github.com/robertwayne/axum-htmx
synced 2024-11-30 15:04:32 +01:00
cargo fmt
This commit is contained in:
parent
f622f12bba
commit
c6f8bcb504
1 changed files with 8 additions and 6 deletions
|
@ -1,16 +1,18 @@
|
||||||
use crate::{
|
use std::sync::Arc;
|
||||||
headers::{HX_REQUEST_STR, HX_TARGET_STR},
|
|
||||||
HxError,
|
|
||||||
};
|
|
||||||
use axum::{extract::Request, middleware::Next, response::Response};
|
use axum::{extract::Request, middleware::Next, response::Response};
|
||||||
use axum_core::response::IntoResponse;
|
use axum_core::response::IntoResponse;
|
||||||
use http::{
|
use http::{
|
||||||
header::{HeaderValue, VARY},
|
header::{HeaderValue, VARY},
|
||||||
Extensions,
|
Extensions,
|
||||||
};
|
};
|
||||||
use std::sync::Arc;
|
|
||||||
use tokio::sync::oneshot::{self, Receiver, Sender};
|
use tokio::sync::oneshot::{self, Receiver, Sender};
|
||||||
|
|
||||||
|
use crate::{
|
||||||
|
headers::{HX_REQUEST_STR, HX_TARGET_STR},
|
||||||
|
HxError,
|
||||||
|
};
|
||||||
|
|
||||||
const MIDDLEWARE_DOUBLE_USE: &str =
|
const MIDDLEWARE_DOUBLE_USE: &str =
|
||||||
"Configuration error: `axum_httpx::vary_middleware` is used twice";
|
"Configuration error: `axum_httpx::vary_middleware` is used twice";
|
||||||
|
|
||||||
|
@ -91,10 +93,10 @@ pub async fn vary_middleware(mut request: Request, next: Next) -> Response {
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use crate::{HxRequest, HxTarget};
|
|
||||||
use axum::{routing::get, Router};
|
use axum::{routing::get, Router};
|
||||||
|
|
||||||
use super::*;
|
use super::*;
|
||||||
|
use crate::{HxRequest, HxTarget};
|
||||||
|
|
||||||
fn vary_headers(resp: &axum_test::TestResponse) -> Vec<HeaderValue> {
|
fn vary_headers(resp: &axum_test::TestResponse) -> Vec<HeaderValue> {
|
||||||
resp.iter_headers_by_name("vary").cloned().collect()
|
resp.iter_headers_by_name("vary").cloned().collect()
|
||||||
|
|
Loading…
Reference in a new issue