Rhino233
01/22/2022, 8:34 PMJames
01/22/2022, 9:12 PMvirgofx
01/22/2022, 11:57 PMcontext.request.headers
in a Cloudflare Pages function is always an empty object {}
. This is unfortunate as I'm trying to retrieve the User Agent as well as other headers sent by the client. I've JSON.stringify()
the entire context object to see if it was there anywhere and could not find it.
Any thoughts?James
01/23/2022, 12:35 AMHeaders
object, which will return {}
when serialized. But if you try something like context.request.headers.forEach(console.log)
you should see them all.James
01/23/2022, 12:36 AMheaders.get('user-agent')
for examplevirgofx
01/23/2022, 12:36 AMvirgofx
01/23/2022, 1:06 AMJames
01/23/2022, 1:07 AMJc
01/23/2022, 8:05 PMJames
01/23/2022, 8:09 PMJames
01/23/2022, 8:10 PMJc
01/23/2022, 8:20 PMzsmooth
01/23/2022, 8:27 PMJames
01/23/2022, 8:28 PMJc
01/23/2022, 8:28 PMJames
01/23/2022, 8:29 PMitsmatteomanf
01/23/2022, 10:35 PMfunctions/
folder and it's deployed at the same time as the project with the new changes, no way to fix that right? Any solution apart from double deploys?Greg Brimble | Cloudflare Pages
01/23/2022, 11:31 PMitsmatteomanf
01/23/2022, 11:31 PMitsmatteomanf
01/23/2022, 11:32 PMGreg Brimble | Cloudflare Pages
01/23/2022, 11:33 PMfunctions
for some sort of static generation?Greg Brimble | Cloudflare Pages
01/23/2022, 11:33 PMitsmatteomanf
01/23/2022, 11:34 PMnuxt generate
, and it's fetching the same API (as it would break the current version).itsmatteomanf
01/23/2022, 11:34 PMGreg Brimble | Cloudflare Pages
01/23/2022, 11:34 PMGreg Brimble | Cloudflare Pages
01/23/2022, 11:35 PMGreg Brimble | Cloudflare Pages
01/23/2022, 11:36 PMitsmatteomanf
01/23/2022, 11:37 PMwrangler@beta pages dev
thing within the build image. The fact that you can atomically deploy things together allows you to remove versioning in the internal API which is always a pain.itsmatteomanf
01/23/2022, 11:39 PMnuxt
it's that the downloaded file is fully rendered, without additional JS files. For the specific call I'm doing it changes little as it's the data for a map which needs to be rendered on the client, but future calls will be different.itsmatteomanf
01/23/2022, 11:40 PM