aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--rs/server/src/main.rs12
-rw-r--r--rs/shell/src/main.rs10
2 files changed, 17 insertions, 5 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)
diff --git a/rs/shell/src/main.rs b/rs/shell/src/main.rs
index b9c50d8..ef0ef48 100644
--- a/rs/shell/src/main.rs
+++ b/rs/shell/src/main.rs
@@ -1,4 +1,4 @@
1use std::{process::ExitCode, os::unix::process::CommandExt}; 1use std::{os::unix::process::CommandExt, process::ExitCode};
2 2
3fn parse_sq(s: &str) -> Option<(String, &str)> { 3fn parse_sq(s: &str) -> Option<(String, &str)> {
4 #[derive(PartialEq, Eq)] 4 #[derive(PartialEq, Eq)]
@@ -7,13 +7,13 @@ fn parse_sq(s: &str) -> Option<(String, &str)> {
7 Unquoted { may_escape: bool }, 7 Unquoted { may_escape: bool },
8 UnquotedEscaped, 8 UnquotedEscaped,
9 } 9 }
10 10
11 let mut result = String::new(); 11 let mut result = String::new();
12 let mut state = SqState::Unquoted { may_escape: false }; 12 let mut state = SqState::Unquoted { may_escape: false };
13 let mut remaining = ""; 13 let mut remaining = "";
14 for (i, c) in s.char_indices() { 14 for (i, c) in s.char_indices() {
15 match state { 15 match state {
16 SqState::Unquoted { may_escape: false} => { 16 SqState::Unquoted { may_escape: false } => {
17 if c != '\'' { 17 if c != '\'' {
18 return None; 18 return None;
19 } 19 }
@@ -26,7 +26,7 @@ fn parse_sq(s: &str) -> Option<(String, &str)> {
26 } 26 }
27 result.push(c); 27 result.push(c);
28 } 28 }
29 SqState::Unquoted { may_escape: true }=> { 29 SqState::Unquoted { may_escape: true } => {
30 if is_posix_space(c) { 30 if is_posix_space(c) {
31 remaining = &s[i..]; 31 remaining = &s[i..];
32 break; 32 break;
@@ -47,7 +47,7 @@ fn parse_sq(s: &str) -> Option<(String, &str)> {
47 } 47 }
48 48
49 if state != (SqState::Unquoted { may_escape: true }) { 49 if state != (SqState::Unquoted { may_escape: true }) {
50 return None 50 return None;
51 } 51 }
52 Some((result, remaining)) 52 Some((result, remaining))
53} 53}