My webapp is running on
example-domain2.com but Tinode is running on
example-domain1.com.
Its not possible to upload files to the filesystem because of cors errors:
Tinode log:
I2021/02/05 21:37:51 Upload request /v0/file/u/
I2021/02/05 21:37:51 media upload: 405 operation or method not allowed / method 'OPTIONS' not allowed
Browser log:
Access to fetch at 'https://example-domain1.com:6060/v0/file/u/' from origin 'https://www.example-domain2.com' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
I tried:
I modified tinode.conf file and changed:
"fs": {
"upload_dir": "uploads"
},
to:
"fs": {
"upload_dir": "uploads",
"cors_origins": ["*"]
},
similar like in "s3":{...} example. But it does not work either.
Any ideas how to fix this problem is there is no Access-Control-Allow-Origin header on Tinode's? Thanks.