69 / bunnycdn-storage-js

a small/simple wrapper for the bunnycdn storage api
MIT License
20 stars 8 forks source link

getting unauthorized #2

Open ourialkada opened 3 years ago

69 commented 3 years ago

Hi, the module still seems to be working just fine for me. Could you be a bit more specific as to where you are getting an Unauthorized error?

AbsoluteDestiny commented 3 years ago

I also have this problem but I know why - the storage api has different urls depending on the region the zone is in see https://docs.bunny.net/reference/storage-api

This means that the baseurl could be any of:

storage.bunnycdn.com ny.storage.bunnycdn.com la.storage.bunnycdn.com sg.storage.bunnycdn.com syd.storage.bunnycdn.com

so to support other zones, this would need to be configurable.

69 commented 3 years ago

I added an option to specify the primary region in 8f139e0. Could you check it out and see if this fixes it?

joshlit commented 3 years ago

I'm trying to set thinsg up and I'm getting the same issue. I'm running on ny storage zone and I've set that but still nada.

Any idea? cheers.

Edit: nvm. You'll get 'Unauthorized' if you're trying to use the API from a browser (their servers check for referer header)