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

.webp file gives 403 error when viewing even if I'm admin #659

Open
GuySartorelli opened this issue Nov 26, 2024 · 5 comments
Open

.webp file gives 403 error when viewing even if I'm admin #659

GuySartorelli opened this issue Nov 26, 2024 · 5 comments

Comments

@GuySartorelli
Copy link
Member

In CMS 6 (haven't tested 5.3, check that before implementing a fix) I can upload .webp files just fine, but attempting to view them (even the thumbnails in asset-admin after a refresh) gives a 403 error.

@emteknetnz
Copy link
Member

emteknetnz commented Nov 27, 2024

Cannot replicate on either CMS 5 or CMS 6. I tried using the "tree" webp sample on https://developers.google.com/speed/webp/gallery1 (I've double checked I tested using the webp, not the jpeg)

@emteknetnz emteknetnz removed their assignment Nov 27, 2024
@GuySartorelli
Copy link
Member Author

GuySartorelli commented Nov 28, 2024

I assume you mean 4.webp - that file also gives me this behaviour. Might be a dev environment specific problem, I'll have to investigate further. For reference I'm using DDEV.

@GuySartorelli GuySartorelli self-assigned this Nov 28, 2024
@GuySartorelli
Copy link
Member Author

Looks like my public/assets/.htaccess file isn't including webp in the allowed file extensions. Adding it manually resolves this.
@emteknetnz Can you please check for webp in the RewriteCond line of that file after the "# Block invalid file extensions" comment?

@GuySartorelli
Copy link
Member Author

GuySartorelli commented Nov 28, 2024

Further on this - deleting that htaccess file and then making a request to my site results in the file being regenerated, which does include webp.

So I think what's happening is Silverstripe CMS is finding the copy of https://github.com/silverstripe/silverstripe-installer/blob/5/public/assets/.htaccess in my public/assets dir and going "cool the file exists, no need to recreate it"

@emteknetnz
Copy link
Member

emteknetnz commented Nov 28, 2024

My public/assets/.htaccess file contains webp

    # Allow specific file extensions
    RewriteCond %{REQUEST_URI} !^[^.]*[^\/]*\.(?i:css|js|ace|arc|arj|asf|au|avi|bmp|brf|bz2|cab|cda|csv|dmg|doc|docx|dotx|flv|gif|gz|hqx|ico|jpeg|jpg|kml|m4a|m4v|mid|midi|mkv|mov|mp3|mp4|mpa|mpeg|mpg|ogg|ogv|pages|pcx|pdf|png|pps|ppt|pptx|potx|ra|ram|rm|rtf|sit|sitx|tar|tgz|tif|tiff|txt|wav|webm|webp|wma|wmv|xls|xlsx|xltx|zip|zipx|graphql)$
    RewriteRule .* - [F]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants