mirror of
https://github.com/perstarkse/minne.git
synced 2026-03-24 18:31:45 +01:00
fix: response redirect of non hx req
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
use axum::{
|
||||
extract::State,
|
||||
http::{HeaderName, StatusCode},
|
||||
response::{Html, IntoResponse, Response},
|
||||
response::{Html, IntoResponse, Redirect, Response},
|
||||
Extension,
|
||||
};
|
||||
use axum_htmx::{HxRequest, HX_TRIGGER};
|
||||
@@ -185,7 +185,11 @@ where
|
||||
}
|
||||
}
|
||||
TemplateKind::Redirect(path) => {
|
||||
(StatusCode::OK, [(axum_htmx::HX_REDIRECT, path.clone())], "").into_response()
|
||||
if is_htmx {
|
||||
(StatusCode::OK, [(axum_htmx::HX_REDIRECT, path)], "").into_response()
|
||||
} else {
|
||||
Redirect::to(&path).into_response()
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user