ソースを参照

Prevent parsing the output code text as response header

Bart van Strien 6 年 前
コミット
adcdd6cd62
1 ファイル変更2 行追加1 行削除
  1. 2 1
      src/common/HTTPRequest.cpp

+ 2 - 1
src/common/HTTPRequest.cpp

@@ -1,6 +1,7 @@
 #include <sstream>
 #include <string>
 #include <memory>
+#include <limits>
 
 #include "HTTPRequest.h"
 #include "PlaintextConnection.h"
@@ -83,7 +84,7 @@ HTTPSClient::Reply HTTPRequest::request(const HTTPSClient::Request &req)
 			return reply;
 
 		response >> reply.responseCode;
-		response.ignore(1, '\n');
+		response.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
 
 		for (std::string line; getline(response, line, '\n') && line != "\r"; )
 		{