Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Links within linked files don't get signed URLs #1163

Open
BnjBlm opened this issue Aug 4, 2022 · 0 comments
Open

Links within linked files don't get signed URLs #1163

BnjBlm opened this issue Aug 4, 2022 · 0 comments

Comments

@BnjBlm
Copy link

BnjBlm commented Aug 4, 2022

I'm using django-storages (S3Boto3Storage) to upload my media files and libraries to S3 buckets.

index.html:

{% load static %}
HElloworld.
<a href="{% static 'blablah.html' %}">blablah.html</a>   

blablah.html:

some dumb text file
dumber_textfile.txt
<a href="blablahblah.html">blablahblah.html</a>

blablahblah.html:

some dumber textfile
  • The link to blablah.html on index.html works fine. The URL is the signed: https://mybucketname.s3.amazonaws.com/blablah.html?X-Amz-Algorithm=ALG_REDACTED&X-Amz-Credential=CREDENTIAL_INFO_REDACTED%2Fus-east-2%2Fs3%2Faws4_request&X-Amz-Date=20220804T011840Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=host&X-Amz-Signature=SIGNATURE_REDACTED

  • However, the link on blablah.html to blablahblah.html does not work. The URL is unsigned: https://mybucketname.s3.amazonaws.com/blablahblah.html and returns a 403.

How do I get the link to blablahblah.html to be signed without making the file accessible to the public at large? Assume I can't edit the contents of blablah.html (if it were, for example, a CSS file from a library).

edit: updated the problem to a MWE

@BnjBlm BnjBlm changed the title S3Boto3Storage linked image file URLS unsigned S3Boto3Storage linked files within linked files don't get signed URLs Aug 5, 2022
@BnjBlm BnjBlm changed the title S3Boto3Storage linked files within linked files don't get signed URLs Links within linked files don't get signed URLs Aug 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant