web permissions2

This commit is contained in:
Priec
2026-08-11 14:33:24 +02:00
parent 5602140d05
commit 077d69d756
47 changed files with 2348 additions and 674 deletions

View File

@@ -6,7 +6,7 @@
use axum::{
extract::{Query, State},
http::{HeaderMap, HeaderValue, StatusCode, header},
http::{HeaderMap, HeaderValue, StatusCode},
response::{Html, IntoResponse, Redirect, Response},
};
use axum_extra::extract::Form;
@@ -107,10 +107,10 @@ pub(crate) async fn create_table(
let Ok(location) = HeaderValue::try_from(location) else {
return (StatusCode::INTERNAL_SERVER_ERROR, "Invalid redirect").into_response();
};
let mut response = StatusCode::SEE_OTHER.into_response();
response
.headers_mut()
.insert(header::LOCATION, location.clone());
// `hx-redirect` alone, with no body and no 3xx: the form is posted
// over XHR, and the browser would follow a `Location` itself,
// leaving htmx to swap the whole redirected page into `#builder`.
let mut response = Html(String::new()).into_response();
response.headers_mut().insert("hx-redirect", location);
response
}