소스 검색

Allow leading and trailing whilespaces before/after header field values

yhirose 8 년 전
부모
커밋
c76d0e4ab3
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      httplib.h

+ 1 - 1
httplib.h

@@ -598,7 +598,7 @@ inline int get_header_value_int(const Headers& headers, const char* key, int def
 
 inline bool read_headers(Stream& strm, Headers& headers)
 {
-    static std::regex re("(.+?): (.+?)\r\n");
+    static std::regex re(R"((.+?):\s*(.+?)\s*\r\n)");
 
     const auto bufsiz = 2048;
     char buf[bufsiz];