Say I have website.com and has redirect configuration for /api to https://api.com which essentially an Express app with CORS setup for both domains. When I look at req.get('origin')
I got nothing. What can I expect from this value? And what would be the best way to capture website.com as origin?
Am I being naïve or would a proxy rewrite sort you out?
Hi @Scott,
That’s exactly what I did with proxy rewrite. I know I can add custom headers but I just need to pass through the origin, does that make sense?
Hey @spondbob,
Would referer
work for you?
I think so, express should easily pull that from header data. I haven’t really tried it but what can I expect from referer
with a request coming from Netlify’s redirect?
From what I can see if I make a fetch request within the app I can easily pull origin
and referrer
. But if I hit straight the redirect endpoint to browser address bar, I got none of them. Is it something expected with redirect implementation? In this case what would be the best way to get website.com as origin? @Scott @jen
I think you’re gonna wanna do something like this and add the referrer as needed !