Bug 1673748 - Fix incorrect test r=asuth

When responding with a script, the correct Content-Type header must be
set.

Differential Revision: https://phabricator.services.mozilla.com/D94902
This commit is contained in:
Yaron Tausky 2020-10-27 23:32:54 +00:00
Родитель 246ca6e02b
Коммит 3d223d237e
1 изменённых файлов: 8 добавлений и 2 удалений

Просмотреть файл

@ -224,12 +224,18 @@ onfetch = function(ev) {
} else if (ev.request.url.includes("nonexistent_worker_script.js")) {
ev.respondWith(
Promise.resolve(
new Response("postMessage('worker-intercept-success')", {})
new Response("postMessage('worker-intercept-success')", {
headers: { "Content-Type": "text/javascript" },
})
)
);
} else if (ev.request.url.includes("nonexistent_imported_script.js")) {
ev.respondWith(
Promise.resolve(new Response("check_intercepted_script();", {}))
Promise.resolve(
new Response("check_intercepted_script();", {
headers: { "Content-Type": "text/javascript" },
})
)
);
} else if (ev.request.url.includes("deliver-gzip")) {
// Don't handle the request, this will make Necko perform a network request, at