Add resource header for mime sniffing (#39167)

The concept of a "resource header" is not well specced, since it is
unclear what a "resource" is. That said, it most closely matches a
"response" as part of the navigation params.

With this change, we now delay loading the document until either two
things happen:
1. We reached the end of the file
2. We processed 1445 bytes (as defined by spec)

We initially store bytes in the resource header and then after loading
parse the stored bytes. Any subsequent loading will process as before.

Part of #14024

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
This commit is contained in:
Tim van der Lippe 2025-09-07 14:31:57 +02:00 committed by GitHub
parent e3de39893f
commit a672ffb850
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 133 additions and 83 deletions

View file

@ -49,9 +49,3 @@
[Response: combined response Content-Type: text/html;" \\" text/plain ";charset=GBK]
expected: FAIL
[<iframe>: separate response Content-Type: text/html;x=" text/plain]
expected: FAIL
[<iframe>: combined response Content-Type: text/html;x=" text/plain]
expected: FAIL

View file

@ -1,3 +1,4 @@
[navigation-type-post-backforward.html]
expected: TIMEOUT
[Navigation type after posting and navigating away and back should be back_forward.]
expected: FAIL
expected: TIMEOUT