-
-
Notifications
You must be signed in to change notification settings - Fork 10.6k
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
"Publication icon" does not work well with custom storage adapter #8885
Comments
I've not verified this bug, as it lives in custom storage adapters and that's not something anyone the core team makes regular use of. However, it sounds very plausible. A pull request to fix this would be very welcome. |
I wonder why custom storage adapters return the url from the storage provider when storing the image (e.g. Because imagine you want to use a different storage adapter, you just need to move your images to the new provider, but the path is still the same, just the underlying storage has changed. By that we wouldn't run into this bug. So right now a storage adapter is able to store a whole external url for images. cc @ErisDS |
In general we want the front-end to make as few hops as possible to load assets, if storage engine urls are stored as
Changing content storages then gives you problems where images will still fail for some users anyway because the CDN and browsers will have cached the 301. If we send a 302 response then it will constantly re-checked by browsers and CDNs and you lose a lot of the benefits of local caches. The other option would be Ghost proxying to the storage engine, that's fine for images which are stored on a local file system/server but for remote images Ghost itself will now be making long requests for each asset:
becomes:
|
Another way to look at it is that locally stored files are actually the special case. Every other custom storage adapter provided by the community deals with full URLs. |
…831) refs TryGhost/Ghost#8885 - detect an absolute URL when setting the icon style in `{{gh-nav-menu}}`
This was fixed via TryGhost/Admin@7dd2090.
This sounds like a duplicate of #8771. I'm going to close this for now as it appears all issues have been resolved. We can open more specific issues if there are any further issues with favicon. |
Issue Summary
"Publication icon" does not work well with custom storage adapter.
Steps to Reproduce
Setup a custom storage module, mine is https://github.com/unit2b/ghost-oss-store
Upload a "Publication icon"
Upload works, but the url of the most top left icon in admin UI is wrong, it's something looks like
https://yordomain.com/https://static.yordomain.com/logo.png
, site url is prepended by mistake.favicon middleware failed to serve a favicon image, it tries to read the icon file from storage adapter with a full url. In this circumstance, favicon middleware should simply do a redirection.
Technical details:
I checked the Database, when custom storage adapter is applied,
icon
option insettings
will be a full url, howevericon
related stuffs are not ready for a full url.The text was updated successfully, but these errors were encountered: