Cors-like error in server actions + github codespaces
Hey, for various reasons I some times use github codespaces to develop. I’m struggling with this error when calling server actions from the client.
`x-forwarded-host` header with value `domain…-3000.app.github.dev` does not match `origin` header with value `localhost:3000` from a forwarded Server Actions request. Aborting the action.
POST /testing 500 in 7ms
⨯ Error: Invalid Server Actions request.
at AsyncLocalStorage.run (node:async_hooks:346:14)
at AsyncLocalStorage.run (node:async_hooks:346:14)
digest: "4009385968"
`x-forwarded-host` header with value `domain…-3000.app.github.dev` does not match `origin` header with value `localhost:3000` from a forwarded Server Actions request. Aborting the action.
POST /testing 500 in 7ms
⨯ Error: Invalid Server Actions request.
at AsyncLocalStorage.run (node:async_hooks:346:14)
at AsyncLocalStorage.run (node:async_hooks:346:14)
digest: "4009385968"
Solution:
Solved, needed both the domain and localhost in allowed origins…