kristian
01/12/2021, 4:13 PMeidam | SuperSaaS
01/12/2021, 4:21 PMadaptive
01/12/2021, 4:30 PMtimsuchanek
01/12/2021, 5:46 PMtimsuchanek
01/12/2021, 5:47 PMeidam | SuperSaaS
01/12/2021, 5:48 PMtimsuchanek
01/12/2021, 5:53 PMDeleted User
01/12/2021, 6:41 PMcapslock
01/12/2021, 7:16 PMcapslock
01/12/2021, 7:17 PMcapslock
01/12/2021, 7:24 PM"Hello": { ..., jp: "こんにちは", fr: "bonjour" }
capslock
01/12/2021, 7:26 PMadvaith
01/12/2021, 10:11 PMadvaith
01/12/2021, 10:11 PMSpoofh
01/13/2021, 12:09 AMai
01/13/2021, 12:10 AMSpoofh
01/13/2021, 12:47 AMalbert-zhao
01/13/2021, 12:48 AMSpoofh
01/13/2021, 12:59 AMjavascript
addEventListener('fetch', event => {
event.respondWith(handleRequest(event.request));
})
async function handleRequest(request) {
let requestUrl = new URL(request.url).pathname;
requestUrl = requestUrl.slice(4, requestUrl.length);
const url = "https://UrlToProvider/bucketName.de"
+ requestUrl;
return await fetch(url);
}
My route is
https://my-domain.com/img/*
When i now go to the browser and use the url
https://my-domain.com/img/path/to/img
I normally should get that image, but something strange happens. I get an Access Denied reponse and in this response he searched for a key in the bucket. From this example he searches for
<key>/path/to/img</key>
But thats the wrong key. The slash at the start is to much. But my url still looks fine. I tried to play a bit with the slice function for the requestUrl, but that only breaks everything. As i mentioned, when i pass a real url to the worker, the worker can get the image and recieve a status 200 from the request.Spoofh
01/13/2021, 1:03 AMalbert-zhao
01/13/2021, 1:10 AMSpoofh
01/13/2021, 1:13 AMSpoofh
01/13/2021, 1:13 AMSpoofh
01/13/2021, 1:16 AMginkoid
01/13/2021, 1:18 AMitsmatteomanf
01/13/2021, 1:19 AMSpoofh
01/13/2021, 1:20 AMginkoid
01/13/2021, 1:21 AMginkoid
01/13/2021, 1:21 AMSpoofh
01/13/2021, 1:22 AM