variable_get(CDN_MODE_VARIABLE) not always defaults to CDN_MODE_BASIC
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #2580979. --> Reported by: [bkonetzny](https://www.drupal.org/user/367646) >>> <p>In all files through the module, default CDN mode is defined like this, so it defaults to CDN_MODE_BASIC:</p> <div class="codeblock"> <pre><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br>$mode </span><span style="color: #007700">= </span><span style="color: #0000BB">variable_get</span><span style="color: #007700">(</span><span style="color: #0000BB">CDN_MODE_VARIABLE</span><span style="color: #007700">, </span><span style="color: #0000BB">CDN_MODE_BASIC</span><span style="color: #007700">);<br></span><span style="color: #0000BB">?&gt;</span></span></pre></div> <p>There is one exception however, which is cdn_get_domains() where it defaults to FALSE in two conditions:</p> <div class="codeblock"> <pre><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br>variable_get</span><span style="color: #007700">(</span><span style="color: #0000BB">CDN_MODE_VARIABLE</span><span style="color: #007700">, </span><span style="color: #0000BB">FALSE</span><span style="color: #007700">)<br></span><span style="color: #0000BB">?&gt;</span></span></pre></div> <p>We had a server which was running CDN for a while and didn't have the CDN mode explicitly set, so all code did work as expected as it defaulted to "basic" except the DNS prefetch metatags from _cdn_prefetch_dns(), as this domain list was built with CDN mode defaulting to FALSE.</p>
issue