Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
yhirose committed Feb 12, 2021
1 parent bc80d7c commit cf475bc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion httplib.h
Original file line number Diff line number Diff line change
Expand Up @@ -5257,7 +5257,7 @@ inline bool ClientImpl::read_response_line(Stream &strm, const Request &req,

if (!line_reader.getline()) { return false; }

const static std::regex re("(HTTP/1\\.[01]) (\\d{3}) (.*?)\r\n");
const static std::regex re("(HTTP/1\\.[01]) (\\d{3})(?: (.*?))?\r\n");

std::cmatch m;
if (!std::regex_match(line_reader.ptr(), m, re)) {
Expand Down
1 change: 1 addition & 0 deletions test/test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1644,6 +1644,7 @@ TEST_F(ServerTest, GetMethod200) {
ASSERT_TRUE(res);
EXPECT_EQ("HTTP/1.1", res->version);
EXPECT_EQ(200, res->status);
EXPECT_EQ("OK", res->reason);
EXPECT_EQ("text/plain", res->get_header_value("Content-Type"));
EXPECT_EQ(1, res->get_header_value_count("Content-Type"));
EXPECT_EQ("Hello World!", res->body);
Expand Down

0 comments on commit cf475bc

Please sign in to comment.