Create a WPT test to verify handling of locahost and *.locahost
Categories
(Core :: Networking: DNS, task, P3)
Tracking
()
People
(Reporter: fredw, Unassigned)
References
Details
(Whiteboard: [necko-triaged])
In bug 1220810, we are adding tests to check that locahost and *.localhost are Potentially Trustworthy
dom/security/test/gtest/TestSecureContext.cpp
dom/security/test/unit/test_isOriginPotentiallyTrustworthy.js
It does not seem the change affects the WPT results and I can only find internal tests at
https://chromium-review.googlesource.com/c/chromium/src/+/598068/
https://chromium-review.googlesource.com/c/chromium/src/+/2002584
I'm not yet sure whether there is something that makes testing this in WPT difficult, but I'm opening this bug for the record.
Comment 1•4 years ago
|
||
If you want to mimic the Chrome tests I don't know if WPT is the best option here.
The easiest would be to go for xpcshell-tests like this one: https://searchfox.org/mozilla-central/source/netwerk/test/unit/test_dns_override.js
Basically you'd add an override for localhost/something.localhost, resolve them and make sure they still resolve to 127.0.0.1 or ::1
Do you want to take the bug?
Reporter | ||
Comment 2•4 years ago
|
||
@Valentin: Testing that the *.localhost and localhost are potentially trustworthy is already done internally:
dom/security/test/gtest/TestSecureContext.cpp
dom/security/test/unit/test_isOriginPotentiallyTrustworthy.js
I agree, we can also add a test to ensure they really redirect to 127.0.0.1 or ::1 ; and yes I can give a try and do that in a separate bug.
The main reason why I opened this bug is because it's required by https://wiki.mozilla.org/ExposureGuidelines#Intent_to_prototype
web-platform-tests: Please link to the test suite. If any part of the feature is not tested by web-platform-tests, or if you had to write gecko-only tests for parts of the feature, please include links to one or more of:
A web-platform-tests issue explaining why a certain thing cannot be tested (example).
A spec issue for some change that would make it possible to test (example).
A Bugzilla bug for the creating web-platform-tests.
But I haven't investigate how difficult it would be.
Comment 3•4 years ago
|
||
Ok, that's fair. Thanks for doing this btw!
Reporter | ||
Comment 4•4 years ago
|
||
Changing the title to make this a bit broader.
More tests are added in bug 1673315 (as per comment 1) but this is still internal.
Updated•3 years ago
|
Updated•7 months ago
|
Description
•