Having trouble figuring out how to read headers in an edge function request

Has anyone had this happen to them? I'm creating an edge function, and to make sure it only gets called from a cron job, I added a "x-supabase-webhook-source" header (using the "custom source header" option). The header shows up when I test locally, but when I deploy the edge function, the function can no longer see the header. Should I be looking for request headers somewhere other than req.headers?
No description
No description
3 Replies
garyaustin
garyaustin3d ago
Hosted seems to work for me:
No description
No description
garyaustin
garyaustin3d ago
The TEST tool in dashboard seems tricky on the headers. You have to click + add a header after you have added the header.
Jeremy
JeremyOP3d ago
Damn, that really was it I'm still getting a 401 error when the cron job runs, but it might be something else, I'll do some debugging

Did you find this page helpful?