diff options
author | Rutger Broekhoff | 2024-01-24 17:04:32 +0100 |
---|---|---|
committer | Rutger Broekhoff | 2024-01-24 17:04:32 +0100 |
commit | 35c6a80e95ca3d29749203c601182f07f80d19a7 (patch) | |
tree | d23b4174593173906e3c93bb1dea5aae1ea95579 /rs/server | |
parent | 9c20f00b100197b3f999a269d7545ea7905be1bc (diff) | |
download | gitolfs3-35c6a80e95ca3d29749203c601182f07f80d19a7.tar.gz gitolfs3-35c6a80e95ca3d29749203c601182f07f80d19a7.zip |
Add debug log for mime type validation
Diffstat (limited to 'rs/server')
-rw-r--r-- | rs/server/src/main.rs | 12 |
1 files changed, 12 insertions, 0 deletions
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 { | |||
299 | let Ok(mime) = mimetype.parse::<mime::Mime>() else { | 299 | let Ok(mime) = mimetype.parse::<mime::Mime>() else { |
300 | return false; | 300 | return false; |
301 | }; | 301 | }; |
302 | println!( | ||
303 | "MIME type: {:?}; type: {}, subtype: {}, suffix: {}, charset: {}", | ||
304 | mime, | ||
305 | mime.type_(), | ||
306 | mime.subtype(), | ||
307 | mime.suffix() | ||
308 | .map(|name| name.to_string()) | ||
309 | .unwrap_or("<no suffix>".to_string()), | ||
310 | mime.get_param(mime::CHARSET) | ||
311 | .map(|name| name.to_string()) | ||
312 | .unwrap_or("<no charset>".to_string()) | ||
313 | ); | ||
302 | if mime.type_() != mime::APPLICATION | 314 | if mime.type_() != mime::APPLICATION |
303 | || mime.subtype() != "vnd.git-lfs" | 315 | || mime.subtype() != "vnd.git-lfs" |
304 | || mime.suffix() != Some(mime::JSON) | 316 | || mime.suffix() != Some(mime::JSON) |