Skip to content

How can I access pantry objects in the browser? #188

Closed Answered by davestaab
rajlego asked this question in Q&A
Discussion options

You must be logged in to vote

CORS is a feature of browsers and part of internet security. You can't disable it. The opaque response mentioned in the error response is probably not the solution you are looking for.

Short answer, you can't access pantry directly from javascript running in the browser. You need to provide your own middle tier to handle requests.

Even if you could, Pantry works with a secret key (the pantry id) that you don't want to give away. Putting that key in your javascript code is giving it away to your users. They would then have access to do anything they want with your data.

Hope this helps.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by imRohan
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants