summaryrefslogtreecommitdiffstats
path: root/dom/serviceworkers/test/fetch/upgrade-insecure/upgrade-insecure_test.js
blob: f79307f4e474ca3b5b11b56f2c3262482f536c7e (plain)
1
2
3
4
5
6
7
8
9
10
11
self.addEventListener("fetch", function(event) {
  if (event.request.url.includes("index.html")) {
    event.respondWith(fetch("realindex.html"));
  } else if (event.request.url.includes("image-20px.png")) {
    if (event.request.url.indexOf("https://") == 0) {
      event.respondWith(fetch("image-40px.png"));
    } else {
      event.respondWith(Response.error());
    }
  }
});