Deploy again

This commit is contained in:
Andras Schmelczer 2026-02-19 22:24:06 +00:00
parent ffe080adef
commit 787428f1a5
18 changed files with 717 additions and 223 deletions

View file

@ -11,6 +11,7 @@ use crate::state::AppState;
const OG_PLACEHOLDER: &str = r#"<meta name="x-og-placeholder" content="__PERFECT_POSTCODE_OG_TAGS__"/>"#;
pub async fn og_middleware(request: Request, next: Next) -> Response {
let path = request.uri().path().to_string();
// Capture the query string before passing the request through
let query_string = request.uri().query().unwrap_or("").to_string();
@ -19,6 +20,11 @@ pub async fn og_middleware(request: Request, next: Next) -> Response {
let response = next.run(request).await;
// Only inject OG tags into SPA HTML responses, not proxied PocketBase responses
if path.starts_with("/pb/") || path.starts_with("/api/") {
return response;
}
let content_type = response
.headers()
.get(header::CONTENT_TYPE)