diff --git a/src/http_server.cc b/src/http_server.cc index 33dc7a9fc2..cce57ee254 100644 --- a/src/http_server.cc +++ b/src/http_server.cc @@ -1093,7 +1093,12 @@ CompressionTypeUsed(const std::string accept_encoding) try { type_weight = std::stod(encoding.substr(weight_pos + 3)); } + catch (const std::out_of_range& oor) { + type_weight = 0; + continue; + } catch (const std::invalid_argument& ia) { + type_weight = 0; continue; } }