pmeenan / cf-workers

Collection of Cloudflare Workers
MIT License
155 stars 22 forks source link

CSP Not Defined After Latest Changes #1

Closed ScottTravisHartley closed 5 years ago

ScottTravisHartley commented 5 years ago

The recent commits to the streaming optimizations has an error leading to console warnings in the worker editor.

// Bypass processing for image requests (for most browsers, Firefox doesn't include image/* on the accept) if (!isImage) { const url = new URL(event.request.url); if (event.request.method === 'GET' && isProxyRequest(url)) { // Pass the requests through to the origin server // (through the underlying request cache and filtering headers). event.respondWith(proxyRequest('https:/' + url.pathname + url.search, csp.request)); } else { event.respondWith(processRequest(event.request, event)); } } });

CSP is not defined in the above block (around line 37)

pmeenan commented 5 years ago

Argh, thanks. I think I did a search for csp and accidentally overwrote where the cursor was at the time. Should be fixed now

ScottTravisHartley commented 5 years ago

Yep, looks like it was resolved!