test: Browserprüfung System, Klicktests, Header-Test (#1221, #1222)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GmHhg7hLrpgArYQDUZQTAJ
This commit is contained in:
2026-11-23 16:48:51 +01:00
parent e35e01087a
commit 44259ef7da
4 changed files with 82 additions and 5 deletions

View File

@ -10,7 +10,7 @@ use super::{
use crate::state::AppState;
use axum::body::{Body, Bytes};
use axum::extract::{RawQuery, State};
use axum::http::header::{CACHE_CONTROL, CONTENT_DISPOSITION, CONTENT_TYPE};
use axum::http::header::{CONTENT_DISPOSITION, CONTENT_TYPE};
use axum::http::{HeaderMap, StatusCode};
use axum::response::Response;
use std::sync::Arc;
@ -246,7 +246,6 @@ pub(super) async fn diagnose(
);
secure(Response::builder().status(StatusCode::OK))
.header(CONTENT_TYPE, "application/gzip")
.header(CACHE_CONTROL, "no-store")
.header(
CONTENT_DISPOSITION,
format!("attachment; filename=\"{name}\""),

View File

@ -6223,6 +6223,11 @@ async fn system_seite_zeigt_karten_und_der_diagnoseknopf_ist_nur_fuer_admin_mit_
);
let ok = post(admin.clone(), format!("csrf={csrf}")).await;
assert_eq!(ok.status(), 200);
assert_eq!(
ok.headers().get_all("cache-control").iter().count(),
1,
"Cache-Control genau einmal"
);
assert_eq!(ok.headers()["cache-control"], "no-store");
assert!(
ok.headers()["content-disposition"]