Response headers should be filtered when sent from NetworkProcess to WebProcess
[WebKit.git] / LayoutTests / http / wpt / service-workers / header-filtering-worker.js
1 var source;
2 addEventListener("message", (e) => {
3     source = e.source;
4     source.postMessage(e.data === "ready?" ? "ready" : "not ready");
5 });
6
7 addEventListener("fetch", async (e) => {
8     var promise = fetch(e.request);
9     e.respondWith(promise.then((response) => {
10         if (self.internals)
11             source.postMessage(internals.fetchResponseHeaderList(response).sort());
12         else
13             source.postMessage("Test requires internals API to get all response headers");
14         return response;
15     }));
16 });