andrii-kryvoviaz / slink

Self-hosted image sharing service.
GNU Affero General Public License v3.0
313 stars 9 forks source link

Message: Cross-site POST form submissions are forbidden #16

Closed mms-gianni closed 7 months ago

mms-gianni commented 7 months ago

Hey there

Great tool and congrats on your launch.

I'm trying to install slink on my local kubernetes cluster. But I'm not able to get around these CORS header errors.

The Domain I'm using is "slink.a.localhost" on http

I've added the ENV variable CORS_ALLOW_ORIGIN with the values

Since I'm running it on a kubernetes cluster it might be possible Nginx is tripping away some headers (even if it should not)

Any ideas on how to debug it? Or maybe improve this message?

andrii-kryvoviaz commented 7 months ago

That CORS error comes from the SvelteKit. It has csrf protection enabled by default. Most likely you haven't set ORIGIN environment variable.

See more information on it here: https://kit.svelte.dev/docs/adapter-node#environment-variables-origin-protocolheader-hostheader-and-port-header

mms-gianni commented 7 months ago

THX ... this indeed fixed it.

Added ORIGIN=http://slink.a.localhost

Works like charm now.