Fix CPPHTTPLIB_ALLOW_LF_AS_LINE_TERMINATOR (#1634)

This commit is contained in:
Duncan Ogilvie 2023-08-03 23:01:40 +02:00 committed by GitHub
parent c7ed1796a7
commit 67f6ff7fa9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -6723,9 +6723,9 @@ inline bool ClientImpl::read_response_line(Stream &strm, const Request &req,
if (!line_reader.getline()) { return false; }
#ifdef CPPHTTPLIB_ALLOW_LF_AS_LINE_TERMINATOR
const static std::regex re("(HTTP/1\\.[01]) (\\d{3})(?: (.*?))?\r\n");
#else
const static std::regex re("(HTTP/1\\.[01]) (\\d{3})(?: (.*?))?\r?\n");
#else
const static std::regex re("(HTTP/1\\.[01]) (\\d{3})(?: (.*?))?\r\n");
#endif
std::cmatch m;