sathoro
05/24/2023, 3:15 PMBenParr
05/24/2023, 3:22 PMCyb3r-Jok3
05/24/2023, 3:38 PMsathoro
05/24/2023, 3:39 PMsathoro
05/24/2023, 3:39 PMsathoro
05/24/2023, 3:40 PMKartik
05/24/2023, 3:41 PMKartik
05/24/2023, 3:42 PMkian
05/24/2023, 3:42 PMKartik
05/24/2023, 3:45 PMapp.get("*", async (ctx) => {
const cacheurl = new URL(ctx.req.url);
// console.log(cacheurl);
console.log(ctx.req.headers.get("pix-api"));
let headers = new Headers();
headers.set("pix-api", "api-key");
cacheurl.host = "example.com";
const result = await fetch(cacheurl, {
headers,
});
// response = new Response(result.body);
// ctx.executionCtx.waitUntil(cache.put(cacheKey, response.clone()));
return new Response(result.body, {
headers: {
...headers,
"res-pix-api": result.headers.get("pix-api") || "Not Found",
},
});
Kartik
05/24/2023, 3:46 PMdave
05/24/2023, 3:48 PMkian
05/24/2023, 3:49 PMheaders
is always going to be blank other than pix-api
in that scenario.BenParr
05/24/2023, 3:50 PMkian
05/24/2023, 3:50 PMheaders
with let headers = new Headers();
which is an empty object and then only contains the pix-api
header which you set.kian
05/24/2023, 3:50 PMctx.req.headers
Kartik
05/24/2023, 3:50 PMKartik
05/24/2023, 4:00 PMKartik
05/24/2023, 4:00 PMπ£πΈπ«π²
05/24/2023, 4:07 PMkian
05/24/2023, 4:11 PMkian
05/24/2023, 4:11 PMkian
05/24/2023, 4:11 PMNeiki
05/24/2023, 4:44 PMhttps://cdn.discordapp.com/attachments/779390076219686943/1110971634870923367/image.pngβΎ
Licoricevntrs
05/24/2023, 4:48 PMNeiki
05/24/2023, 4:56 PMπ£πΈπ«π²
05/24/2023, 5:04 PMlastguru
05/24/2023, 5:04 PMπ£πΈπ«π²
05/24/2023, 5:07 PM