Procházet zdrojové kódy

Allow leading and trailing whilespaces before/after header field values

yhirose před 8 roky
rodič
revize
c76d0e4ab3
1 změnil soubory, kde provedl 1 přidání a 1 odebrání
  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];