Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Safari can't open the page. The error was: "cannot parse response". #1438

Open
sourcesimian opened this issue Oct 14, 2024 · 0 comments
Open

Comments

@sourcesimian
Copy link

On iOS 18.1 Safari returns Safari can't open the page. The error was: "cannot parse response". for chunked responses.

This appears to be caused by

outLen = sprintf((char*)buf+headLen, "%x", readLen) + headLen;
while(outLen < headLen + 4) buf[outLen++] = ' ';

which can introduce trailing whitespace padding for chunk sizes less than 0x1000, which RFC 2616 (Section 3.6.1) seems to say that no extra whitespace is allowed after the chunk size other than the CRLF.

Reproducer (open: http://127.0.0.1:8088)
demo-bad.http.txt

while true; do nc -l 8088 < ./demo-bad.http.txt; done

Working:
demo-good.http.txt

while true; do nc -l 8088 < ./demo-good.http.txt; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant