DrKrall
DrKrall
Explore posts from servers
CDCloudflare Developers
Created by DrKrall on 8/28/2024 in #pages-help
Problem with local dev setup
Hi everyone, I developing a vite/react project and using page functions for some serverside logic. My problem is that the TS code in ./functions folder does not automatically get updated so I have to restart wrangler every time. If possible I would prefer automatic update without need to restart wrangler. Any ideas on how to get this to work? "dev": "wrangler pages dev --port=3006 -- npx vite --host",
1 replies
CDCloudflare Developers
Created by DrKrall on 5/11/2023 in #workers-help
Can you transform JSON async (like you can with HTMLRewriter)?
I have a lot of JSON data that I need to transform to a common format. Is there anything like HTMLRewriter, but for JSON? The JSON payload is getting too big to be stored in mem in my worker
9 replies
CDCloudflare Developers
Created by DrKrall on 5/9/2023 in #workers-help
302 Redirect headers are missing
Is it possible to extract the original headers from a worker fetch request to an end-point which returns a 302? e.g. const res = await fetch("http://localhost:3000/", { "redirect": "manual" }) res = {"body":{},"bodyUsed":false,"headers":{},"url":"http://localhost:3000/","redirected":false,"ok":false,"statusText":"Found","status":302} If I run the same request via curl I get the original headers (e.g. location + set-cookie): curl -v http://localhost:3000/ < HTTP/2 302 < cache-control: private < location: https://www.google.com < set-cookie: SIGNIN.REQUEST=1683699853; path=/; secure; HttpOnly < access-control-expose-headers: Request-Context < date: Tue, 09 May 2023 14:49:59 GMT < content-length: 0 Is it possible to extract the original headers using Cloudflare workers (or any other Cloudflare service)? The main problem is that the set-cookie header is lost.
13 replies