Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /fetch/compression-dictionary/dictionary-insecure-context.tentative.http.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<meta name="timeout" content="long"/>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/common/get-host-info.sub.js"></script>
<script src="/common/utils.js"></script>
<script src="./resources/compression-dictionary-util.sub.js"></script>
</head>
<body>
<script>
compression_dictionary_promise_test(async (t) => {
// Try to register the dictionary via HTTP (insecure context)
const dict = await (await fetch(kRegisterDictionaryPath)).text();
assert_equals(dict, kDefaultDictionaryContent);
// Wait 1 second to be sure it had time to register if it were allowed.
// We cannot use registerAltDictionaryAndWait because it also wouldn't register.
await new Promise(resolve => t.step_timeout(resolve, 1000));
// Verify the dictionary is not available for subsequent requests
const headers = await checkHeaders({});
assert_false("available-dictionary" in headers);
}, 'Dictionaries must not be registered in insecure contexts');
</script>
</body>