1
0
mirror of https://github.com/actix/actix-extras.git synced 2025-06-26 02:19:22 +02:00

Fix panic on invalid URL characters #130

This commit is contained in:
Nikolay Kim
2018-03-22 18:08:12 -07:00
parent b942bcc4a6
commit 5a25fd95f5
4 changed files with 21 additions and 11 deletions

View File

@ -126,7 +126,7 @@ impl HttpResponseParser {
let mut resp = httparse::Response::new(&mut headers);
match resp.parse(b)? {
httparse::Status::Complete(len) => {
let version = if resp.version.unwrap() == 1 {
let version = if resp.version.unwrap_or(1) == 1 {
Version::HTTP_11
} else {
Version::HTTP_10