mirror of
https://github.com/NetworkCats/rustyip.git
synced 2026-11-15 00:15:02 +00:00
style: apply rustfmt formatting fixes
This commit is contained in:
+1
-3
@@ -26,9 +26,7 @@ pub async fn security_headers(request: Request, next: Next) -> Response {
|
||||
);
|
||||
headers.insert(
|
||||
header::HeaderName::from_static("permissions-policy"),
|
||||
HeaderValue::from_static(
|
||||
"camera=(), microphone=(), geolocation=(), interest-cohort=()",
|
||||
),
|
||||
HeaderValue::from_static("camera=(), microphone=(), geolocation=(), interest-cohort=()"),
|
||||
);
|
||||
headers.insert(
|
||||
header::HeaderName::from_static("cross-origin-opener-policy"),
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
use axum::Router;
|
||||
use axum::middleware;
|
||||
use axum::routing::get;
|
||||
use axum::Router;
|
||||
|
||||
use crate::handlers::{self, AppState};
|
||||
use crate::middleware::security_headers;
|
||||
|
||||
@@ -2,8 +2,8 @@ use std::collections::HashMap;
|
||||
use std::sync::LazyLock;
|
||||
|
||||
use axum::extract::Path;
|
||||
use axum::http::header::{self, HeaderValue};
|
||||
use axum::http::StatusCode;
|
||||
use axum::http::header::{self, HeaderValue};
|
||||
use axum::response::{IntoResponse, Response};
|
||||
|
||||
use static_files::Resource;
|
||||
@@ -13,10 +13,7 @@ include!(concat!(env!("OUT_DIR"), "/generated.rs"));
|
||||
static ASSETS: LazyLock<HashMap<&'static str, Resource>> = LazyLock::new(generate);
|
||||
|
||||
pub fn asset_version(filename: &str) -> u64 {
|
||||
ASSETS
|
||||
.get(filename)
|
||||
.map(|r| r.modified)
|
||||
.unwrap_or(0)
|
||||
ASSETS.get(filename).map(|r| r.modified).unwrap_or(0)
|
||||
}
|
||||
|
||||
pub async fn serve_static(Path(path): Path<String>) -> Response {
|
||||
@@ -26,7 +23,10 @@ pub async fn serve_static(Path(path): Path<String>) -> Response {
|
||||
|
||||
(
|
||||
[
|
||||
(header::CONTENT_TYPE, HeaderValue::from_static(resource.mime_type)),
|
||||
(
|
||||
header::CONTENT_TYPE,
|
||||
HeaderValue::from_static(resource.mime_type),
|
||||
),
|
||||
(
|
||||
header::CACHE_CONTROL,
|
||||
HeaderValue::from_static("public, max-age=31536000, immutable"),
|
||||
|
||||
Reference in New Issue
Block a user