electerious / Ackee

Self-hosted, Node.js based analytics tool for those who care about privacy.
https://ackee.electerious.com
MIT License
4.2k stars 350 forks source link

Convert multiValueHeaders to headers on Vercel #332

Closed birjj closed 2 years ago

birjj commented 2 years ago

As mentioned in #330 it appears that the polyfill used by Vercel to support the AWS Lambda API for serverless functions doesn't support .multiValueHeaders. Since @vendia/serverless-express (which apollo-server-lambda relies on) uses .multiValueHeaders exclusively, this means that CORS headers aren't attached to requests correctly when hosting the project on Vercel. See the linked issue for more information.

Note that this should probably be fixed by Vercel, and I have opened a support case with them to make them aware of the problem. They say that their goal is to respond within 3-5 days, which we might want to wait for. This PR is more of a workaround until they fix their implementation of the AWS Lambda API.

vercel[bot] commented 2 years ago

Someone is attempting to deploy a commit to a Personal Account owned by @electerious on Vercel.

@electerious first needs to authorize it.

electerious commented 2 years ago

Thanks a lot for your help! Will do some additional testing. The fix should be live by tomorrow.