diff --git a/src/http/requests.rs b/src/http/requests.rs index da41498..170c769 100644 --- a/src/http/requests.rs +++ b/src/http/requests.rs @@ -26,6 +26,12 @@ impl URL { Some(key) => key.to_string(), None => continue, }; + // Skip empty keys should they appear + if key.len() == 0 { + continue; + } + + let value = key_value .next() .unwrap_or("") @@ -125,6 +131,7 @@ mod tests { let url = URL::new("/path/to/resource".to_string()).unwrap(); assert_eq!(url.path, "/path/to/resource"); + assert_eq!(url.query.len(), 0); let url = URL::new("/path/to/resource?query=string".to_string()).unwrap(); assert_eq!(url.path, "/path/to/resource");