From 35c6a80e95ca3d29749203c601182f07f80d19a7 Mon Sep 17 00:00:00 2001 From: Rutger Broekhoff Date: Wed, 24 Jan 2024 17:04:32 +0100 Subject: Add debug log for mime type validation --- rs/server/src/main.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'rs/server') diff --git a/rs/server/src/main.rs b/rs/server/src/main.rs index 2051b62..7060b15 100644 --- a/rs/server/src/main.rs +++ b/rs/server/src/main.rs @@ -299,6 +299,18 @@ fn is_git_lfs_json_mimetype(mimetype: &str) -> bool { let Ok(mime) = mimetype.parse::() else { return false; }; + println!( + "MIME type: {:?}; type: {}, subtype: {}, suffix: {}, charset: {}", + mime, + mime.type_(), + mime.subtype(), + mime.suffix() + .map(|name| name.to_string()) + .unwrap_or("".to_string()), + mime.get_param(mime::CHARSET) + .map(|name| name.to_string()) + .unwrap_or("".to_string()) + ); if mime.type_() != mime::APPLICATION || mime.subtype() != "vnd.git-lfs" || mime.suffix() != Some(mime::JSON) -- cgit v1.2.3