Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I swear this was not happening before but it is now. The header tags when referencing image urls for things like og:image are rendering like so:
//assets.sitename.com//assets.sitename.com/sites/default/files/video_embed_field_thumbnails/youtube/youtubeid.jpg
This issue is not occurring anywhere else.
As a work around I have blacklisted the following:
*files/video_embed_field_thumbnails/*
This is not related to the module: video_embed_field as I see this on standard image fields as well.
Any help or guidance would be greatly appreciated.
Comments
Comment #2
Wim LeersComment #3
glynster CreditAttribution: glynster commentedThanks for your quick response.
1. CDN v7.x.2.8
2. Settings:
Details
Other
Exceptions
Blacklist:
sites/all/modules/admin_menu/*
*files/video_embed_field_thumbnails/*
*files/class/*
Blacklist from modules:
image_captcha*
*simpletest/verbose/*
Drupal Path
Blacklist:
nothing
Drupal path for authenticated users
Blacklist:
admin*
3. The module I was referring to is "Metatag": https://www.drupal.org/project/metatag
Let me know what else I can supply please.
Comment #4
Wim LeersThanks!
<meta>
tag in the<head>
of the HTML with and without the CDN module?metatag_opengraph
module that you're using?(I started looking at http://cgit.drupalcode.org/metatag/tree/metatag_opengraph to find the culprit, but without the above information, I'm not sure whether that's the right place to start digging.)
Comment #5
glynster CreditAttribution: glynster commentedOK good news I think to help identity the issue.
When we include https://assets.sitename.com in both Details/Other sections the metatags are correctly rendered in the head like so:
However when the above issue occurred we were using //assets.sitename.com in both Details/Other sections metatags are incorrectly rendered in the head like so:
Without the CDN module the head reads:
To confirm using the full url inside Details/Other resolves the problem.
Comment #6
Wim LeersAhh! Yes, this is why the port of the CDN module in Drupal 8 moves to protocol-relative URLs in ALL use cases.
So you have two options:
http://
tohttps://
automatically.Did that solve your problem?
Comment #7
glynster CreditAttribution: glynster commentedGreat! 1 resolved the issue, the second option did not. By using option 2 the url was reverted back to not using the CDN and you cannot use a relative url otherwise https: is not added.
Again thanks for the prompt help in resolving our issue!
Comment #8
Wim LeersAh right, I guess the D7 module doesn't really support protocol-relative CDN URLs. Wim--. This is why I made the D8 module much more strict, so that such edge cases cannot happen anymore.
Glad that helped :)