Open Bug 1559996 Opened 5 years ago Updated 2 years ago

Link rel=prefetch may fire onload without sending network request.

Categories

(Core :: DOM: Networking, defect, P2)

68 Branch
defect

Tracking

()

UNCONFIRMED

People

(Reporter: brandm, Unassigned)

References

Details

(Whiteboard: [necko-triaged])

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3825.0 Safari/537.36 Edg/77.0.193.0

Steps to reproduce:

See new WPT tests for Sec-Fetch-* headers added here: https://github.com/web-platform-tests/wpt/pull/17200

Repro:
Setup environment to run WPT tests.

Load: /fetch/sec-metadata/redirect/redirect-https-downgrade.tentative.sub.html
e.g. http://web-platform.test:8001/fetch/sec-metadata/redirect/redirect-https-downgrade.tentative.sub.html

-Ctrl + Click the refresh icon to reload the test in a new tab.

The specific test case that's causing issues is adding a link element with the rel=prefetch attribute to the documents head element and performing validation during the onload event of the link element.

Actual results:

Some of the time (maybe 2-3/10 loads) the prefetch test case will fail unexpectedly with a different value 'assert_not_equals: got disallowed value "No header has been recorded"'

When this happens the onload event is fired which triggers validation (fetch request to the wptserv instance to validate a previous request for the prefetch resource was received). However no network request for the prefetch resource occurs either before or after the onload is fired.

Expected results:

The resource specified in the link element should have been requested then the onload should have fired. The test result, PASS/FAIL, should be deterministic when run multiple times.

Hi @brandm, what can I do for now with this issue is setting a component, if isn't the right one please fell free to change it- further someone from dev's team could give us a hand.
Thanks.

Component: Untriaged → Networking
Product: Firefox → Core
Component: Networking → DOM: Networking
Priority: -- → P2
Whiteboard: [necko-triaged]
Blocks: 1568817
Severity: normal normal → S3 S3
You need to log in before you can comment on or make changes to this bug.