blob: d9ecca277b3fae5bc4698ff467a85714be7b15a3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
|
self.addEventListener('fetch', function(event) {
var url = event.request.url;
if (url.indexOf('sample?test') == -1) {
return;
}
event.respondWith(new Promise(function(resolve) {
var headers = new Headers;
headers.append('TEST', 'ßÀ¿'); // header value holds the Latin1 (ISO8859-1) string.
resolve(new Response('hello world', {'headers': headers}));
}));
});
|