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

Commit 67de9cd

Browse files
dl9rdzhr-ru
andauthored
tentative fix (#1436)
Co-authored-by: Hans P. Reiser <[email protected]>
1 parent 7f37534 commit 67de9cd

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/WebResponses.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,13 +312,14 @@ size_t AsyncAbstractResponse::_ack(AsyncWebServerRequest *request, size_t len, u
312312
if(_chunked){
313313
// HTTP 1.1 allows leading zeros in chunk length. Or spaces may be added.
314314
// See RFC2616 sections 2, 3.6.1.
315+
// -- OR NOT: There is nothing about spaces there, and it breaks Webkit browsers on iOS!
315316
readLen = _fillBufferAndProcessTemplates(buf+headLen+6, outLen - 8);
316317
if(readLen == RESPONSE_TRY_AGAIN){
317318
free(buf);
318319
return 0;
319320
}
320-
outLen = sprintf((char*)buf+headLen, "%x", readLen) + headLen;
321-
while(outLen < headLen + 4) buf[outLen++] = ' ';
321+
outLen = sprintf((char*)buf+headLen, "%04x", readLen) + headLen;
322+
// while(outLen < headLen + 4) buf[outLen++] = ' ';
322323
buf[outLen++] = '\r';
323324
buf[outLen++] = '\n';
324325
outLen += readLen;

0 commit comments

Comments
 (0)