diff options
Diffstat (limited to 'tests/wpt/web-platform-tests/service-workers/cache-storage/script-tests/cache-match.js')
-rw-r--r-- | tests/wpt/web-platform-tests/service-workers/cache-storage/script-tests/cache-match.js | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/wpt/web-platform-tests/service-workers/cache-storage/script-tests/cache-match.js b/tests/wpt/web-platform-tests/service-workers/cache-storage/script-tests/cache-match.js index 3d00f0f04af..ba359fed142 100644 --- a/tests/wpt/web-platform-tests/service-workers/cache-storage/script-tests/cache-match.js +++ b/tests/wpt/web-platform-tests/service-workers/cache-storage/script-tests/cache-match.js @@ -1,6 +1,7 @@ if (self.importScripts) { importScripts('/resources/testharness.js'); importScripts('../resources/test-helpers.js'); + importScripts('/common/get-host-info.sub.js'); } prepopulated_cache_test(simple_entries, function(cache, entries) { @@ -318,4 +319,22 @@ cache_test(function(cache) { }); }, 'Cache produces large Responses that can be cloned and read correctly.'); +cache_test(async (cache) => { + const url = get_host_info().HTTPS_REMOTE_ORIGIN + + '/service-workers/cache-storage/resources/simple.txt?pipe=' + + 'header(access-control-allow-origin,*)|' + + 'header(access-control-expose-headers,*)|' + + 'header(foo,bar)|' + + 'header(set-cookie,X)'; + + const response = await fetch(url); + await cache.put(new Request(url), response); + const cached_response = await cache.match(url); + + const headers = cached_response.headers; + assert_equals(headers.get('access-control-expose-headers'), '*'); + assert_equals(headers.get('foo'), 'bar'); + assert_equals(headers.get('set-cookie'), null); + }, 'cors-exposed header should be stored correctly.'); + done(); |