Report this

What is the reason for this report?

Why do I get 403 errors for some Spaces objects?

Posted on November 18, 2020

Hello,

I’ve setup a Django app with a Space linked to it.

Most files load properly, but somehow some files images won’t.

For example, if you look here https://zonnegrens-nl-kjmoe.ondigitalocean.app/ (ignore fake warning, the original one is also mine, I’m migrating from a droplet to an app)

You’ll see the file header.jpg gets a 403 Forbidden. If I open it without the query parameters, it loads. So the file exists but just is forbidden: https://ams3.digitaloceanspaces.com/zonnegrens/static/images/header.jpg

Same goes for https://ams3.digitaloceanspaces.com/zonnegrens/static/images/web-app-icon-192x192.png (also 403 while the site loads)

All the other assets load without problems.

The bucket is public.

I’ve set CORS to the DO-generated domain name.

One thing I noticed is that the header image is loaded from CSS as a background-image and the others are loaded via image tags.

Am I missing something?

Thanks a lot!

Gijs



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

It has to do with html entity encoding of the URLs. Probably something with the setup of django-storages or boto3.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.