1body = b''' 2'use strict'; 3 4onconnect = (event) => { 5 const port = event.ports[0]; 6 7 port.onmessage = (event) => { 8 fetch(event.data, { mode: 'no-cors' }) 9 .then( 10 () => port.postMessage('success'), 11 () => port.postMessage('failure') 12 ); 13 }; 14 15 port.postMessage('ready'); 16};''' 17 18def main(request, response): 19 headers = [(b'Content-Type', b'text/javascript')] 20 21 for value in request.GET.get_list(b'value'): 22 headers.append((b'Cross-Origin-Embedder-Policy', value)) 23 24 return (200, headers, body) 25