ptrumpis / snap-camera-server

An alternative, self-hosted solution that allows you to continue using Snap Camera with all Snapchat filters after its shutdown on January 25, 2023.
https://github.com/snapcamera
MIT License
330 stars 40 forks source link

CORS policy problem with Cache Import #3

Closed magikarp28 closed 1 year ago

magikarp28 commented 1 year ago

Following the tutorial everything works fine but now I need to import some cached lenses I have.

When I press the button to import cache I get this error: POST http://127.0.0.1/vc/v1/import/cache net::ERR_BLOCKED_BY_CLIENT

I do this when the server is running and try to import the settings.json from my snap camera folder in the snap camera folder where the cache folder is located and the files inside that cache folder.

ptrumpis commented 1 year ago

@magikarp28 What browser are you using?

magikarp28 commented 1 year ago

@magikarp28 What browser are you using?

Brave and Chrome give that error. Just tried firefox and it gives a CORS policy error instead.

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://127.0.0.1/vc/v1/import/cache. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). Status code: 200.

Edge gives both errors.

ptrumpis commented 1 year ago

@magikarp28 I updated the code it should be fixed now You just have to download and replace this file (restart server after replacement)

https://raw.githubusercontent.com/ptrumpis/snap-camera-server/main/nginx/default.conf.template

Edit: Btw. I am able to bring ALL lenses back not only cached ones...

New version 3.0.0 is coming soon which will fix all the missing lens problems

magikarp28 commented 1 year ago

Awsome, fixed!