Archived topic
srcset 2x is always HTTP when site is HTTPS
3 replies · Started by Wil on October 22, 2021
I have an SVG logo set in the customizer > site identity > logo
The entire site is HTTPS and has been since it was created.
The URL of the logo in the media library is HTTPS.
However, wherever I visit the site in mobile and only mobile, the logo is output as HTTP in the srcset for x2 and this cases an protocol serving error as the request expects everything in HTTPS, therefore the logo is not displayed.
Here is the srcset for mobile, you can see the very last 2x image has the HTTP protocol instead of HTTPS.
<img class="header-image is-logo-image" alt="company-name" src="https://company-name.local/wp-content/uploads/2021/09/company-name-logo-blue.svg" title="company-name" srcset="https://company-name.local/wp-content/uploads/2021/09/company-name-logo-blue.svg 1x, http://company-name.local/wp-content/uploads/2021/09/company-name-logo-blue.svg 2x" width="302" height="79">
I've set all elements to draft status so they are not interfering.
I've activated the GeneratePress theme directly (I have a child theme) and the same thing happens.
Is this a bug?
Wil.
Hi there,
thats odd - was the retina logo uploaded and added to the site before the SSL was enabled ?
The simplest fix is to NOT add an Retina logo - SVGs don't require retina unless they have an <img> embedded within them ( checking your logo it does not ), as they don't have a fixed pixel density.
Just FYI, there was no retina image in the customiser.
As soon as I added one the issue disappeared, however, it looks like there may be a bug if there is no retina image loaded.
GP won't add the Retina src-set unless a retina logo was added at some time.
The only 'glitch' is if a logo was there and either later removed from the Media Library or its URL/Slug was changed - then you see an empty field in the customizer, when there is actually an image there. Which may have been the case here.
You should be able to remove the retina logo now and it should remove it from the src-set.