Skip to content

Commit 3f9bdcb

Browse files
committed
Fixed loading normal payload with curl a user agent
1 parent 7f18bc0 commit 3f9bdcb

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/HTTPRequest.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,10 +227,15 @@ void HTTPRequest::loadPayload() {
227227
}
228228

229229
void HTTPRequest::loadNormalPayload() {
230+
loaded = false;
230231
while (_payload.size() < _content_length) {
231-
if (!readLine(true)) return;
232-
_payload += line;
232+
try {
233+
_payload += _chunked_socket.read();
234+
} catch (IOException &) {
235+
return; // Poll again...
236+
}
233237
}
238+
loaded = true;
234239
}
235240

236241
void HTTPRequest::loadChunkedPayload() {

0 commit comments

Comments
 (0)