Double slash in URL since upgrade to Drupal 10

Created on 19 September 2023, 10 months ago
Updated 23 January 2024, 5 months ago

Problem/Motivation

I upgraded some time ago from D9 (latest version) to D10 (latest version), and now I noticed this:
In D9 my cdn URL was:
https://cdn.cardivision.com/sites/default/files/css/css_GxtpwgEmveTh7dhq6hr...
In D10 my cdn URL is:
https://cdn.cardivision.com//sites/default/files/css/css_GxtpwgEmveTh7dhq6hr...

If I deactivate the CDN URLs are normal.
A similar D9 (with the latest cdn module) website doesn't add a double slash in the URL "//". and before the upgrade the URLs were normal.

Is this double slash normal behavior?
If not, what can I do?

https://prnt.sc/quc9k7nr2-qJ

This is my Nginx config for D9 and D10. This config in d9 works without "//"

add_header X-Frame-Options "SAMEORIGIN";
add_header X-XSS-Protection "1; mode=block";
add_header X-Content-Type-Options "nosniff";
add_header X-Permitted-Cross-Domain-Policies "none";
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload";

# Allow "Well-Known URIs" as per RFC 5785
location ~* ^/.well-known/ {
    allow all;
}
#removefor ssl renew?
    if ($host = cardivision.com) {
        return 301 https://www.$host$request_uri;
    } # managed by Certbot
#redirect /files/ to /sites/default/files/
location ~ ^/files/(.*) {
    return 301 $scheme://www.cardivision.com/sites/default/files/$1;
}
#redirect /frontpage/ to /node
location ~ ^/frontpage(.*) {
    return 301 $scheme://www.cardivision.com;
}
#/car-shows-auto-events/ to /node
location ~ ^/car-shows-auto-events(.*) {
    return 301 $scheme://www.cardivision.com;
}
#https://www.nginx.com/resources/wiki/start/topics/recipes/drupal/
location = /12e3o302=op302cache/ {allow all;log_not_found off;access_log off;}
location = /ads.txt {allow all; log_not_found off; access_log off;}
location = /robots.txt {allow all; log_not_found off; access_log off;}
location = /favicon.ico {allow all; expires max; log_not_found off; access_log off;}
# Very rarely should these ever be accessed outside of your lan
location ~* \.(txt|log)$ { allow 192.168.0.0/16; deny all; }

location ~ \..*/.*\.php$ {
    return 403;
}

location ~ ^/sites/.*/private/ {
	return 403;
}

# Block access to scripts in site files directory
location ~ ^/sites/[^/]+/files/.*\.php$ {
	deny all;
}

# Allow "Well-Known URIs" as per RFC 5785
location ~* ^/.well-known/ {
    allow all;
}

# Block access to "hidden" files and directories whose names begin with a
# period. This includes directories used by version control systems such
# as Subversion or Git to store control files.
location ~ (^|/)\. {
  return 403;
}
#https://www.drupal.org/project/drupal/issues/3368769#comment-15117497
location / {
	try_files $uri /index.php?$query_string; # For Drupal >= 7
}

location @rewrite {
	# For D7 and above:
	# Clean URLs are handled in drupal_environment_initialize().
	rewrite ^ /index.php;
}

# Don't allow direct access to PHP files in the vendor directory.
location ~ /vendor/.*\.php$ {
	deny all;
	return 404;
}

# Protect files and directories from prying eyes.
location ~* \.(engine|inc|install|make|module|profile|po|sh|.*sql|theme|twig|tpl(\.php)?|xtmpl|yml)(~|\.sw[op]|\.bak|\.orig|\.save)?$|composer\.(lock|json)$|web\.config$|^(\.(?!well-known).*|Entries.*|Repository|Root|Tag|Template)$|^#.*#$|\.php(~|\.sw[op]|\.bak|\.orig|\.save)$ {
	deny all;
	return 404;
}

    # In Drupal 8, we must also match new paths where the '.php' appears in
    # the middle, such as update.php/selection. The rule we use is strict,
    # and only allows this pattern with the update.php front controller.
    # This allows legacy path aliases in the form of
    # blog/index.php/legacy-path to continue to route to Drupal nodes. If
    # you do not have any paths like that, then you might prefer to use a
    # laxer rule, such as:
    #   location ~ \.php(/|$) {
    # The laxer rule will continue to work if Drupal uses this new URL
    # pattern with front controllers other than update.php in a future
    # release.
    location ~ '\.php$|^/update.php' {
        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
        # Ensure the php file exists. Mitigates CVE-2019-11043
        try_files $fastcgi_script_name =404;
        # Security note: If you're running a version of PHP older than the
        # latest 5.3, you should have "cgi.fix_pathinfo = 0;" in php.ini.
        # See http://serverfault.com/q/627903/94922 for details.
        include fastcgi_params;
        # Block httpoxy attacks. See https://httpoxy.org/.
        fastcgi_param HTTP_PROXY "";
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param PATH_INFO $fastcgi_path_info;
        fastcgi_param QUERY_STRING $query_string;
        fastcgi_intercept_errors on;
        # PHP 5 socket location.
        #fastcgi_pass unix:/var/run/php5-fpm.sock;
        # PHP 7 socket location.
        #fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
        fastcgi_pass unix:/var/run/php/php8.1-fpm.sock;
    }

location ~* \.(js|css|webp|png|jpg|jpeg|gif|ico|svg|eot|ttf|woff|woff2)$ {
	try_files $uri @rewrite;
	etag on;
	expires 365d;
	add_header Pragma "public";
	add_header Cache-Control "public, max-age=31536000, immutable";
	#log_not_found off;
}
#location ~ ^/sites/.*/files/(css|js)/optimized { add_header Cache-Control 'public, max-age=31536000, immutable'; }

# Fighting with Styles? This little gem is amazing.
location ~ ^/sites/.*/files/styles/ {
	try_files $uri @rewrite;
}

# Handle private files through Drupal. Private file's path can come
# with a language prefix.
location ~ ^(/[a-z\-]+)?/system/files/ { # For Drupal >= 7
	try_files $uri /index.php?$query_string;
}

# Enforce clean URLs
# Removes index.php from urls like www.example.com/index.php/my-page --> www.example.com/my-page
# Could be done with 301 (was 307) for permanent or other redirect codes.
if ($request_uri ~* "^(.*/)index\.php(.*)") {
	return 301 $1$2;
}
🐛 Bug report
Status

Fixed

Version

4.0

Component

Code

Created by

🇷🇴Romania idflorin

Live updates comments and jobs are added and updated live.
  • Needs manual testing

    The change/bugfix cannot be fully demonstrated by automated testing, and thus requires manual testing in a variety of environments.

Sign in to follow issues

Comments & Activities

  • Issue created by @idflorin
  • Status changed to Postponed: needs info 9 months ago
  • 🇧🇪Belgium Wim Leers Ghent 🇧🇪🇪🇺

    This is most likely related to changes in Drupal 10 core then, because the CDN module did not change 😬 Can you provide steps to reproduce? 🙏

  • 🇷🇴Romania idflorin

    @Wim Leers
    Yes. It seems to me like something related to changes in Drupal 10 core.
    I updated a drupal 9 installation to drupal 10 and the issue occurred again.
    In the updating process I updated only the drupal core and this happened:
    Head in Drupal 9

      <head>
        <meta charset="utf-8" />
    <noscript><style>form.antibot * :not(.antibot-message) { display: none !important; }</style>
    </noscript><noscript><meta http-equiv="Refresh" content="0; URL=/big_pipe/no-js?destination=/node" />
    </noscript><meta name="Generator" content="Drupal 9 (https://www.drupal.org)" />
    <meta name="MobileOptimized" content="width" />
    <meta name="HandheldFriendly" content="true" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <link rel="icon" href="https://cdn.nodeid.org/favicon.ico" type="image/vnd.microsoft.icon" />
    <link rel="alternate" type="application/rss+xml" title="" href="https://www.nodeid.org/rss.xml" />
    
        <title>Home | Nodeid</title>
        <link rel="stylesheet" media="all" href="https://cdn.nodeid.org/sites/default/files/css/css_S-iAefsPpcMOPEdrzsWMAda5mxmTFJkH0HlYDHs6nXk.css" />
    <link rel="stylesheet" media="screen" href="https://cdn.nodeid.org/sites/default/files/css/css_u4V41heglsayYslETOtLFTnSh16kC9YPM15eokMNuN0.css" />
    <link rel="stylesheet" media="all" href="https://cdn.nodeid.org/sites/default/files/css/css_r0VHZ1sXlVr21ChFtJ0fx_RywacV9w086LLvrL8t5mc.css" />
    <link rel="stylesheet" media="all" href="https://cdn.nodeid.org/sites/default/files/css/css_s9lDtI9R2QyQbhRHBjuFpbOU2jsOI98_LBWrjCjMDew.css" />
    <link rel="stylesheet" media="all" href="//maxcdn.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" />
    <link rel="stylesheet" media="all" href="https://cdn.nodeid.org/sites/default/files/css/css_hysBny5mLBcvGKsF50a4lcPT6eYGW1VKR1uDbMtJU7I.css" />
    <link rel="stylesheet" media="all" href="https://cdn.nodeid.org/themes/businessplus_lite/css/components/messages.css?s2l0nd" />
    <link rel="stylesheet" media="all" href="https://cdn.nodeid.org/sites/default/files/css/css_-6B26-lQ6j22DnsJbD_69teu9I9guP8umb5miNpMNvw.css" />
    <link rel="stylesheet" media="all" href="//use.fontawesome.com/releases/v5.1.0/css/all.css" />
    <link rel="stylesheet" media="print" href="https://cdn.nodeid.org/sites/default/files/css/css_dw-KdAXsVspyVbyzWtO7GXqJzvqCWVpJ0NRRV3g_wKQ.css" />
    <link rel="stylesheet" media="all" href="//fonts.googleapis.com/css?family=Barlow:300,300i,400,400i,500,500i,600,600i,700,700i&amp;amp;subset=latin-ext" />
    <link rel="stylesheet" media="all" href="//fonts.googleapis.com/css?family=Source+Code+Pro&amp;subset=latin,latin-ext" />
    <link rel="stylesheet" media="all" href="//fonts.googleapis.com/css?family=PT+Serif:400,700,400italic,700italic&amp;subset=latin,latin-ext" />
    <link rel="stylesheet" media="all" href="https://cdn.nodeid.org/themes/businessplus_lite/css/theme/color-khaki.css?s2l0nd" />
    <link rel="stylesheet" media="all" href="https://cdn.nodeid.org/sites/default/files/css/css_1sIOChGcNEBHLA_UkvGGsb3t5J3Tx3aW6JcIBF1Zn6Q.css" />
    
        <script src="https://cdn.nodeid.org/core/misc/touchevents-test.js?v=9.5.11"></script>
    <script src="https://cdn.nodeid.org/core/assets/vendor/modernizr/modernizr.min.js?v=3.11.7"></script>
    <script src="https://cdn.nodeid.org/core/misc/modernizr-additional-tests.js?v=3.11.7"></script>
    
      </head>
    

    The same Head in Drupal 10

      <head>
        <meta charset="utf-8" />
    <noscript><style>form.antibot * :not(.antibot-message) { display: none !important; }</style>
    </noscript><noscript><meta http-equiv="Refresh" content="0; URL=/big_pipe/no-js?destination=/node" />
    </noscript><meta name="description" content="Get your free backlinks from the Node id website!" />
    <meta name="keywords" content="node id, free backlinks, dofollow backlinks, backlinks, seo links" />
    <link rel="shortlink" href="https://www.nodeid.org/" />
    <link rel="canonical" href="https://www.nodeid.org/" />
    <meta name="Generator" content="Drupal 10 (https://www.drupal.org)" />
    <meta name="MobileOptimized" content="width" />
    <meta name="HandheldFriendly" content="true" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <link rel="icon" href="https://cdn.nodeid.org/favicon.ico" type="image/vnd.microsoft.icon" />
    <link rel="alternate" type="application/rss+xml" title="" href="https://www.nodeid.org/rss.xml" />
    
        <title>Nodeid</title>
        <link rel="stylesheet" media="all" href="https://cdn.nodeid.org//sites/default/files/css/css_XJcGBW3Pu2L40OPaSa1XTSHcLrLRyS7v371bIC45tBg.css?delta=0&amp;language=en&amp;theme=businessplus_lite&amp;include=eJx9lMFyozAMhl8Iw2UvPfZJMsYooI2xvJKcNn36FQykoWN6wbI_SZb1awjE0A1cso9tZhoZRJpASeFTi487-j5xEdNNGnmIwtz1XqAJ0Ys8DvZsafwISyrLn4hnH_ELmr4IJmM5FrlEVOjGSL1lFX1Y4rHicEz1918BfrSUQi2ZEkXFXCGRwnYLyASgUvG52iP9BwjN4IJsF24N8EHxDuvjG2vEsu5o2zZ3hA_p1m8701BircJsT-HKeaIBnGfFUA1b8N7b1ZaSga8oU4cJ9WX7tC4T3YHRdEt1LqZJlMAAqc5LziSoSKccWEovNVoVxynlQ1cHNO5NykW43nO3rU0R4N1psVu0CdwUWZ7EyYAJmSfgwaLLElr4OUbPk8N16vve6OzTqsKvY75X4ocZ02XbravsVa5FNTIRayi659j3x8hnjFq_f0Htq2o_HUCCz_C-BNdGi7I134WhBnsiFWWfT_jL7FdooEjsbpO_4UmsOBzcn7dTKqZFgGCja3-ZU6-szsTGa9PjeMmYre7N-A9-sNkS" />
    <link rel="stylesheet" media="all" href="https://cdn.nodeid.org//sites/default/files/css/css__nRK0t40CA-G7AiXcCx_bbGF3pk9Wv3gx6ldg2bZzQg.css?delta=1&amp;language=en&amp;theme=businessplus_lite&amp;include=eJx9lMFyozAMhl8Iw2UvPfZJMsYooI2xvJKcNn36FQykoWN6wbI_SZb1awjE0A1cso9tZhoZRJpASeFTi487-j5xEdNNGnmIwtz1XqAJ0Ys8DvZsafwISyrLn4hnH_ELmr4IJmM5FrlEVOjGSL1lFX1Y4rHicEz1918BfrSUQi2ZEkXFXCGRwnYLyASgUvG52iP9BwjN4IJsF24N8EHxDuvjG2vEsu5o2zZ3hA_p1m8701BircJsT-HKeaIBnGfFUA1b8N7b1ZaSga8oU4cJ9WX7tC4T3YHRdEt1LqZJlMAAqc5LziSoSKccWEovNVoVxynlQ1cHNO5NykW43nO3rU0R4N1psVu0CdwUWZ7EyYAJmSfgwaLLElr4OUbPk8N16vve6OzTqsKvY75X4ocZ02XbravsVa5FNTIRayi659j3x8hnjFq_f0Htq2o_HUCCz_C-BNdGi7I134WhBnsiFWWfT_jL7FdooEjsbpO_4UmsOBzcn7dTKqZFgGCja3-ZU6-szsTGa9PjeMmYre7N-A9-sNkS" />
    <link rel="stylesheet" media="all" href="//maxcdn.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" />
    <link rel="stylesheet" media="all" href="https://cdn.nodeid.org//sites/default/files/css/css_QRx2OI87KCjfVTCtcf84ZCXLZJyN3UfyuCrCq1DGHfQ.css?delta=3&amp;language=en&amp;theme=businessplus_lite&amp;include=eJx9lMFyozAMhl8Iw2UvPfZJMsYooI2xvJKcNn36FQykoWN6wbI_SZb1awjE0A1cso9tZhoZRJpASeFTi487-j5xEdNNGnmIwtz1XqAJ0Ys8DvZsafwISyrLn4hnH_ELmr4IJmM5FrlEVOjGSL1lFX1Y4rHicEz1918BfrSUQi2ZEkXFXCGRwnYLyASgUvG52iP9BwjN4IJsF24N8EHxDuvjG2vEsu5o2zZ3hA_p1m8701BircJsT-HKeaIBnGfFUA1b8N7b1ZaSga8oU4cJ9WX7tC4T3YHRdEt1LqZJlMAAqc5LziSoSKccWEovNVoVxynlQ1cHNO5NykW43nO3rU0R4N1psVu0CdwUWZ7EyYAJmSfgwaLLElr4OUbPk8N16vve6OzTqsKvY75X4ocZ02XbravsVa5FNTIRayi659j3x8hnjFq_f0Htq2o_HUCCz_C-BNdGi7I134WhBnsiFWWfT_jL7FdooEjsbpO_4UmsOBzcn7dTKqZFgGCja3-ZU6-szsTGa9PjeMmYre7N-A9-sNkS" />
    <link rel="stylesheet" media="all" href="https://cdn.nodeid.org/themes/businessplus_lite/css/components/messages.css?s2l0wf" />
    <link rel="stylesheet" media="all" href="https://cdn.nodeid.org//sites/default/files/css/css_ZBLnZ5RoDPHIbfzzFOoxTBAcarhowslEjPyzcHjLUtA.css?delta=5&amp;language=en&amp;theme=businessplus_lite&amp;include=eJx9lMFyozAMhl8Iw2UvPfZJMsYooI2xvJKcNn36FQykoWN6wbI_SZb1awjE0A1cso9tZhoZRJpASeFTi487-j5xEdNNGnmIwtz1XqAJ0Ys8DvZsafwISyrLn4hnH_ELmr4IJmM5FrlEVOjGSL1lFX1Y4rHicEz1918BfrSUQi2ZEkXFXCGRwnYLyASgUvG52iP9BwjN4IJsF24N8EHxDuvjG2vEsu5o2zZ3hA_p1m8701BircJsT-HKeaIBnGfFUA1b8N7b1ZaSga8oU4cJ9WX7tC4T3YHRdEt1LqZJlMAAqc5LziSoSKccWEovNVoVxynlQ1cHNO5NykW43nO3rU0R4N1psVu0CdwUWZ7EyYAJmSfgwaLLElr4OUbPk8N16vve6OzTqsKvY75X4ocZ02XbravsVa5FNTIRayi659j3x8hnjFq_f0Htq2o_HUCCz_C-BNdGi7I134WhBnsiFWWfT_jL7FdooEjsbpO_4UmsOBzcn7dTKqZFgGCja3-ZU6-szsTGa9PjeMmYre7N-A9-sNkS" />
    <link rel="stylesheet" media="all" href="//use.fontawesome.com/releases/v5.1.0/css/all.css" />
    <link rel="stylesheet" media="print" href="https://cdn.nodeid.org//sites/default/files/css/css_vpLs-TEuy_xLiIKVnsHm_-nn9xMuOBrw60VAf0VgeMY.css?delta=7&amp;language=en&amp;theme=businessplus_lite&amp;include=eJx9lMFyozAMhl8Iw2UvPfZJMsYooI2xvJKcNn36FQykoWN6wbI_SZb1awjE0A1cso9tZhoZRJpASeFTi487-j5xEdNNGnmIwtz1XqAJ0Ys8DvZsafwISyrLn4hnH_ELmr4IJmM5FrlEVOjGSL1lFX1Y4rHicEz1918BfrSUQi2ZEkXFXCGRwnYLyASgUvG52iP9BwjN4IJsF24N8EHxDuvjG2vEsu5o2zZ3hA_p1m8701BircJsT-HKeaIBnGfFUA1b8N7b1ZaSga8oU4cJ9WX7tC4T3YHRdEt1LqZJlMAAqc5LziSoSKccWEovNVoVxynlQ1cHNO5NykW43nO3rU0R4N1psVu0CdwUWZ7EyYAJmSfgwaLLElr4OUbPk8N16vve6OzTqsKvY75X4ocZ02XbravsVa5FNTIRayi659j3x8hnjFq_f0Htq2o_HUCCz_C-BNdGi7I134WhBnsiFWWfT_jL7FdooEjsbpO_4UmsOBzcn7dTKqZFgGCja3-ZU6-szsTGa9PjeMmYre7N-A9-sNkS" />
    <link rel="stylesheet" media="all" href="//fonts.googleapis.com/css?family=Barlow:300,300i,400,400i,500,500i,600,600i,700,700i&amp;amp;subset=latin-ext" />
    <link rel="stylesheet" media="all" href="//fonts.googleapis.com/css?family=Source+Code+Pro&amp;subset=latin,latin-ext" />
    <link rel="stylesheet" media="all" href="//fonts.googleapis.com/css?family=PT+Serif:400,700,400italic,700italic&amp;subset=latin,latin-ext" />
    <link rel="stylesheet" media="all" href="https://cdn.nodeid.org/themes/businessplus_lite/css/theme/color-khaki.css?s2l0wf" />
    <link rel="stylesheet" media="all" href="https://cdn.nodeid.org//sites/default/files/css/css_tBGd48turajVB6uDHzhjABVcCnAZNV10ctMwcSpJ3PI.css?delta=12&amp;language=en&amp;theme=businessplus_lite&amp;include=eJx9lMFyozAMhl8Iw2UvPfZJMsYooI2xvJKcNn36FQykoWN6wbI_SZb1awjE0A1cso9tZhoZRJpASeFTi487-j5xEdNNGnmIwtz1XqAJ0Ys8DvZsafwISyrLn4hnH_ELmr4IJmM5FrlEVOjGSL1lFX1Y4rHicEz1918BfrSUQi2ZEkXFXCGRwnYLyASgUvG52iP9BwjN4IJsF24N8EHxDuvjG2vEsu5o2zZ3hA_p1m8701BircJsT-HKeaIBnGfFUA1b8N7b1ZaSga8oU4cJ9WX7tC4T3YHRdEt1LqZJlMAAqc5LziSoSKccWEovNVoVxynlQ1cHNO5NykW43nO3rU0R4N1psVu0CdwUWZ7EyYAJmSfgwaLLElr4OUbPk8N16vve6OzTqsKvY75X4ocZ02XbravsVa5FNTIRayi659j3x8hnjFq_f0Htq2o_HUCCz_C-BNdGi7I134WhBnsiFWWfT_jL7FdooEjsbpO_4UmsOBzcn7dTKqZFgGCja3-ZU6-szsTGa9PjeMmYre7N-A9-sNkS" />
    
        <script src="https://cdn.nodeid.org//sites/default/files/js/js_aaf5tEEXs1Jg45uyXRZm0ZkcWaW4U7Ao6vFYfSTnSf4.js?scope=header&amp;delta=0&amp;language=en&amp;theme=businessplus_lite&amp;include=eJx9lMFyozAMhl8Iw2UvPfZJMsYooI2xvJKcNn36FQykoWN6wbI_SZb1awjE0A1cso9tZhoZRJpASeFTi487-j5xEdNNGnmIwtz1XqAJ0Ys8DvZsafwISyrLn4hnH_ELmr4IJmM5FrlEVOjGSL1lFX1Y4rHicEz1918BfrSUQi2ZEkXFXCGRwnYLyASgUvG52iP9BwjN4IJsF24N8EHxDuvjG2vEsu5o2zZ3hA_p1m8701BircJsT-HKeaIBnGfFUA1b8N7b1ZaSga8oU4cJ9WX7tC4T3YHRdEt1LqZJlMAAqc5LziSoSKccWEovNVoVxynlQ1cHNO5NykW43nO3rU0R4N1psVu0CdwUWZ7EyYAJmSfgwaLLElr4OUbPk8N16vve6OzTqsKvY75X4ocZ02XbravsVa5FNTIRayi659j3x8hnjFq_f0Htq2o_HUCCz_C-BNdGi7I134WhBnsiFWWfT_jL7FdooEjsbpO_4UmsOBzcn7dTKqZFgGCja3-ZU6-szsTGa9PjeMmYre7N-A9-sNkS"></script>
    
      </head>

    As you can see the double slash is again.
    href="https://cdn.nodeid.org//sites/default/files/css/css_XJcGBW3Pu2

  • 🇧🇪Belgium Erwin De Vylder

    I have the same problem.

    Steps to reproduce:

    composer create-project drupal/recommended-project my_site_name
    cd my_site_name/
    composer require 'drupal/cdn:4.0.1'
    composer require 'drush/drush:^11.0'
    drush si
    drush en cdn cdn_ui
    

    Make sure aggregate CSS & JS is enabled on /admin/config/development/performance.

    Now, surf to /admin/config/services/cdn and enable simple mapping. Serve all files from
    and set status to Enabled.

    Result: CSS & JS aggregates have an extra slash inserted.

  • 🇧🇪Belgium Erwin De Vylder

    Looks like it may be a core issue indeed.

    In D9.5, core is passing uri's of the form public://css/css_aBcDe... to FileUrlGenerator.

    From D10.0 onwards, core is passing uri's of the form /css/css_aBcDe... to FileUrlGenerator.

  • 🇧🇪Belgium Wim Leers Ghent 🇧🇪🇪🇺

    I'm >95% confident this is fixed by 🐛 FileUrlGenerator::transformRelative() edge case errors Fixed . Can you either apply that patch or wait for Drupal 10.2.1 to be released, and report back? 🙏

    Thanks!

  • 🇧🇪Belgium Wim Leers Ghent 🇧🇪🇪🇺
  • 🇷🇴Romania idflorin

    For me, on several websites:
    Updating to Drupal 10.2 and CDN 4.0.2 fixed this issue.
    Before:
    <link rel="stylesheet" media="all" href="https://cdn.panorica.com//sites/default/files/css/css_LrMQzGJhPNST
    After update:
    <link rel="stylesheet" media="all" href="https://cdn.panorica.com/sites/default/files/css/css_ty1ciNPjQlGzCA

  • 🇧🇪Belgium Wim Leers Ghent 🇧🇪🇪🇺

    @idflorin Then it must've been fixed by another fix in Drupal core because version 4.0.2 did not change anything in this regard 😅

    I'll wait for one more confirmation before closing this. Ideally somebody would test with Drupal 10.1.7 too 🙏

  • 🇷🇴Romania idflorin

    @
    Drupal core 10.1.7 and CDN 4.0.2 fixed the double slash
    Before
    <link rel="stylesheet" media="all" href="https://cdn.spare-wheel.com//sites/default/files/css/css_0rV
    After
    <link rel="stylesheet" media="all" href="https://cdn.spare-wheel.com/sites/default/files/css/css_eA3WM7REU

  • 🇧🇪Belgium Wim Leers Ghent 🇧🇪🇪🇺

    @idflorin Yay! I can't seem to find which change in https://www.drupal.org/project/drupal/releases/10.1.7 would have fixed this though.

    Which makes me wonder if it's been fixed for longer 🤔

    Which Drupal core version did you update from?

  • 🇧🇪Belgium Erwin De Vylder

    @idflorin you need to test using CDN module version 4.0.1. Version 4.0.2 contains a dirty fix for this very issue :-)

    # Dirty fix until https://www.drupal.org/project/cdn/issues/3388223 is fixed
    if (str_starts_with($uri, '/sites/default/files/css/') || str_starts_with($uri, '/sites/default/files/js/')) {
      $uri = substr($uri, 1);
    }
    

    I did some checks on my side:
    10.1.4 + CDN 4.0.1 -> double slash
    10.1.4 + CDN 4.0.2 -> no double slash
    10.1.7 + CDN 4.0.1 -> double slash
    10.1.7 + CDN 4.0.2 -> no double slash

    So, nothing's fixed in 10.1.7.

  • 🇧🇪Belgium Wim Leers Ghent 🇧🇪🇪🇺

    Version 4.0.2 contains a dirty fix for this very issue :-)

    Eh? 😅 What is that dirty fix then? 😄

  • 🇧🇪Belgium Erwin De Vylder

    Oh. OMG. That was MY dirty fix 🙄 Guess I misinterpreted the diff, probably due to a lack of caffeine :-)

    Anyways. This is the very commit that seems to fix the issue in CDN 4.0.2: https://git.drupalcode.org/project/cdn/-/commit/f6f3d0b5111aeaefe9443afa...

    Ergo: the issue is fixed in CDN 4.0.2. Hooray!

  • 🇧🇪Belgium Wim Leers Ghent 🇧🇪🇪🇺

    Hahahaha 🤣

    The commit you linked is from April … and OMG you're right, that had not yet shipped!? 😱 I'm so sorry!

    Conclusion: this is a duplicate of 📌 10.1.x compatibility: tests are failing against Drupal 10.1.x due to upstream changes Fixed , but it's my fault for not having tagged a release including that sooner. Very sorry 🙈

    Credited you both!

  • Status changed to Fixed 6 months ago
  • 🇧🇪Belgium Wim Leers Ghent 🇧🇪🇪🇺
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.69.0 2024