diff options
| author | Reiner Herrmann <reiner@reiner-h.de> | 2019-02-27 20:28:12 +0100 |
|---|---|---|
| committer | Reiner Herrmann <reiner@reiner-h.de> | 2019-02-27 20:28:12 +0100 |
| commit | 82e96ffd27f0a803a4ede5d0fe2953584c09ad1b (patch) | |
| tree | 3e9e7c592690d69490857b7ac7b16a60393cc08c /src | |
| parent | c659a6d621a4171d03f42b539b4b1a8d00b8b194 (diff) | |
Parse mode and options in lowercase
Diffstat (limited to 'src')
| -rw-r--r-- | src/tftp.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/tftp.rs b/src/tftp.rs index 3319bc4..b37b1b3 100644 --- a/src/tftp.rs +++ b/src/tftp.rs @@ -106,7 +106,8 @@ impl Tftp { self.options = default_options(); options.retain(|key, val| { - match key.as_str() { + let val = val.to_lowercase(); + match key.to_lowercase().as_str() { "blksize" => { match val.parse() { Ok(b) if b >= 8 && b <= 65464 => { @@ -161,7 +162,7 @@ impl Tftp { let filename = Path::new(&filename); let (mode, len) = match self.get_tftp_str(&buf[pos ..]) { - Some(args) => args, + Some((m,l)) => (m.to_lowercase(), l), None => return Err(dataerr), }; pos += len + 1; |
