Open Bug 1784025 Opened 3 years ago Updated 3 years ago

Test preloading multipart image with unknown content-type

Categories

(Core :: Networking: HTTP, task, P2)

task

Tracking

()

People

(Reporter: manuel, Unassigned)

References

(Blocks 1 open bug)

Details

(Whiteboard: [necko-triaged])

The early hint preloader loads content similar to the main document.
mozilla::net::DocumentLoadListener::OnDataAvailable:

This isn't supposed to happen, since we suspended the channel, but
sometimes Suspend just doesn't work. This can happen when we're routing
through nsUnknownDecoder to sniff the content type, and it doesn't handle
being suspended. Let's just store the data and manually forward it to our
redirected channel when it's ready.

So the test should trigger the "sometimes Suspend just doesn't work".

I think the code could be triggered if the preloaded image returns something like this:

200 OK
Content-Type: multipart/x-mixed-replace; boundary=String_separator

--String_separator
Content-type: image/png

atob("iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAIAAAD91JpzAAAADklEQVQIW2OU+i/FAAcADoABNV8XGBMAAAAASUVORK5CYII=") // green/black horizontal stripes

--String_separator
Content-type: image/png

atob("iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAIAAAD91JpzAAAAE0lEQVQIW2P4//+/N8MkBiAGsgA1bAe1SzDY8gAAAABJRU5ErkJggg==") // purple/white checkered pattern

--String_separator--

Further reading on multipart content-type:

Blocks: earlyhints
Summary: Test preloading multipart image with unknown → Test preloading multipart image with unknown content-type

Multi-part support was added in this bug to DocumentLoadListener

See Also: → 1600211
You need to log in before you can comment on or make changes to this bug.