-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Description
Lines 69 to 82 in b5a73fe
| workerTemplate = """addEventListener('fetch', event => { | |
| event.respondWith(handleRequest(event.request)) | |
| }) | |
| async function handleRequest(request) { | |
| let authToken='<B2_DOWNLOAD_TOKEN>' | |
| let b2Headers = new Headers(request.headers) | |
| b2Headers.append("Authorization", authToken) | |
| modRequest = new Request(request.url, { | |
| method: request.method, | |
| headers: b2Headers | |
| }) | |
| const response = await fetch(modRequest) | |
| return response | |
| }""" |
The modRequest variable in line 76 is in the global scope, which shouldn't break the functionality of the worker, but in my opinion it'd be safer to make it local by putting a const keyword before it.
Metadata
Metadata
Assignees
Labels
No labels