Skip to content
This repository has been archived by the owner on Jan 20, 2025. It is now read-only.

Commit

Permalink
tentative fix (#1436)
Browse files Browse the repository at this point in the history
Co-authored-by: Hans P. Reiser <hansr@ru.is>
  • Loading branch information
dl9rdz and hr-ru authored Oct 25, 2024
1 parent 7f37534 commit 67de9cd
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/WebResponses.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -312,13 +312,14 @@ size_t AsyncAbstractResponse::_ack(AsyncWebServerRequest *request, size_t len, u
if(_chunked){
// HTTP 1.1 allows leading zeros in chunk length. Or spaces may be added.
// See RFC2616 sections 2, 3.6.1.
// -- OR NOT: There is nothing about spaces there, and it breaks Webkit browsers on iOS!
readLen = _fillBufferAndProcessTemplates(buf+headLen+6, outLen - 8);
if(readLen == RESPONSE_TRY_AGAIN){
free(buf);
return 0;
}
outLen = sprintf((char*)buf+headLen, "%x", readLen) + headLen;
while(outLen < headLen + 4) buf[outLen++] = ' ';
outLen = sprintf((char*)buf+headLen, "%04x", readLen) + headLen;
// while(outLen < headLen + 4) buf[outLen++] = ' ';
buf[outLen++] = '\r';
buf[outLen++] = '\n';
outLen += readLen;
Expand Down

0 comments on commit 67de9cd

Please sign in to comment.