From 9038a85cef74e5faeaecbe68b8f342ec6a57aa6f Mon Sep 17 00:00:00 2001 From: Casey Rodarmor Date: Mon, 28 Aug 2023 16:08:19 -0700 Subject: [PATCH 1/2] Remove unused content_response match statement --- src/subcommand/server.rs | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/subcommand/server.rs b/src/subcommand/server.rs index adcceb0bf6..08e53a3331 100644 --- a/src/subcommand/server.rs +++ b/src/subcommand/server.rs @@ -875,15 +875,9 @@ impl Server { header::CONTENT_SECURITY_POLICY, HeaderValue::from_static("default-src *:*/content/ *:*/blockheight *:*/blockhash *:*/blockhash/ *:*/blocktime 'unsafe-eval' 'unsafe-inline' data: blob:"), ); - - let body = inscription.into_body(); - let cache_control = match body { - Some(_) => "max-age=31536000, immutable", - None => "max-age=600", - }; headers.insert( header::CACHE_CONTROL, - HeaderValue::from_str(cache_control).unwrap(), + HeaderValue::from_static("max-age=31536000, immutable").unwrap(), ); Some((headers, body?)) From 9cc1e7fca9414372b3d9b058198a12e14d1be28f Mon Sep 17 00:00:00 2001 From: Casey Rodarmor Date: Mon, 28 Aug 2023 17:52:29 -0700 Subject: [PATCH 2/2] Fix --- src/subcommand/server.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/subcommand/server.rs b/src/subcommand/server.rs index bb44c9f469..788ba6d080 100644 --- a/src/subcommand/server.rs +++ b/src/subcommand/server.rs @@ -907,10 +907,10 @@ impl Server { ); headers.insert( header::CACHE_CONTROL, - HeaderValue::from_static("max-age=31536000, immutable").unwrap(), + HeaderValue::from_static("max-age=31536000, immutable"), ); - Some((headers, body?)) + Some((headers, inscription.into_body()?)) } async fn preview(