-
Notifications
You must be signed in to change notification settings - Fork 63
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
WP Stateless Elementor - CSS files wrong MIME type #395
Comments
Hello @MB-Jan, Sorry for the late replay. This issue has been solved. Please update to the latest version of WP-Stateless and check again. Thanks for your awesome detailed issue. |
i dont see that this issue is at all resolved. The problem is in class-sync-non-media.php line 83 $file_type = wp_check_filetype($absolutePath); The default behaviour of WP is that this function will get a list of allowed upload types and then run through them to find if our file matches one of them. However, the default wordpress has css file uploads disabled and this does not change with elementor being installed. Thus, we get back an empty mime type and the upload goes to GCS with an empty mime which defaults to application/octet-stream and the css files dont work. |
WP Stateless Elementor - CSS files wrong MIME type #395
@alimuzzaman: I can confirm what @jimyaghi wrote. Can you please fix the issue. |
@alimuzzaman thank you for being so quick to take care of it. I would really appreciate however if we don't add more libraries unnecessarily to solve the issue. Please see: This is already included in your plugin, why not use it? It works off the official apache recognised list of mime types and is a simple enough routine to extract and write on your own if you prefer to decouple from another library's dependencies. Thanks for being a good sport :) |
@jimyaghi I have copied the function to our class, as the Google library isn't autoloaded (only loaded when syncing media). Thanks |
Hey there,
We are using WP Stateless (2.2.7) with Elementor (2.6.8). CSS files generated by Elementor are correctly being transferred to Google Cloud. Unfortunately, the MIME type is incorrect. It is currently saved with the MIME type
Content-Type: application/octet-stream
which I think needs to be corrected. It appears that browsers are unable to use CSS files with this MIME type properly.
How I checked the MIME type:
A few additional details:
Please let me know if you need to know anything else. I can send the direct file URL in a message on request.
Thank you.
Best regards,
Jan
The text was updated successfully, but these errors were encountered: