File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -4653,7 +4653,17 @@ inline bool ClientImpl::read_response_line(Stream &strm, Response &res) {
4653
4653
const static std::regex re (" (HTTP/1\\ .[01]) (\\ d+) (.*?)\r\n " );
4654
4654
4655
4655
std::cmatch m;
4656
- if (std::regex_match (line_reader.ptr (), m, re)) {
4656
+ if (!std::regex_match (line_reader.ptr (), m, re)) { return false ; }
4657
+ res.version = std::string (m[1 ]);
4658
+ res.status = std::stoi (std::string (m[2 ]));
4659
+ res.reason = std::string (m[3 ]);
4660
+
4661
+ // Ignore '100 Continue'
4662
+ while (res.status == 100 ) {
4663
+ if (!line_reader.getline ()) { return false ; } // CRLF
4664
+ if (!line_reader.getline ()) { return false ; } // next response line
4665
+
4666
+ if (!std::regex_match (line_reader.ptr (), m, re)) { return false ; }
4657
4667
res.version = std::string (m[1 ]);
4658
4668
res.status = std::stoi (std::string (m[2 ]));
4659
4669
res.reason = std::string (m[3 ]);
You can’t perform that action at this time.
0 commit comments