Is there anything wrong with Origin header in HttpLink?
July 1, 2020 at 11:25pmIs there anything wrong with Origin header in HttpLink?
July 1, 2020 at 11:25pm (Edited 7 months ago)Hi,
I ran into an issue where a query to my apollo server was failing on Vercel when using Static Site Generation (via getStaticProps). During build, the request would return a 500 error.
I have managed to fix this by simply adding an origin header in my httplink, like so:
const httpLink = new HttpLink({uri: 'https://api.myDomain.net',credentials: 'include',headers: {Origin: 'https://myDomain.net' // <- This fixed the issue}})
I was wondering though, is there anything wrong with this? It seems too simple and makes me wonder if there is an underlying issue with regards to this working as I have not seen this solution anywhere.
Thanks