aboutsummaryrefslogtreecommitdiff
path: root/src/request/response.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/request/response.rs')
-rw-r--r--src/request/response.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/request/response.rs b/src/request/response.rs
index d38e0bd..a594b6e 100644
--- a/src/request/response.rs
+++ b/src/request/response.rs
@@ -41,7 +41,11 @@ impl Response {
} else {
None
};
- let (status_string, meta_string) = header.split_at(2);
+ let (status_string, meta_string) = if header.len() >= 2 {
+ header.split_at(2)
+ } else {
+ (header.as_str(), "")
+ };
let status_code = status_string.parse::<i32>().unwrap_or(0);
Self {