-
Notifications
You must be signed in to change notification settings - Fork 2
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
CDN use #16
Comments
This should be fixed in 5d8af6b. Can you perhaps test it before I release the next stable version? |
It works but doesn't. Contao strips the protocol from these urls and outputs them as //domain.tld, so the extension works in respect to outputting the url contao has for it, but the output results in an error on facebook:
|
Hmm good point. Can you try cf27bd0 please? This one should work also for https because the CDN should perform a redirect if necessary. |
That works but it depends on the user having his CDN set up correctly and it looks a bit dirty to me. Isn't there a way to check the useSSL flag from Contao and prepend the protocol as needed? |
This is not a good solution I think. First of all if you access the site via Secondly, the |
@stefanschleich well that could be done but the assets and files URL refer to the external server which may or may not use safe protocol contrary to your website. Most of the CDNs use https though but still this is just an assumption based solution and thus not really bulletproof. @fritzmg I am aware of both but is there any other solution? The In fact there could be two extra checkboxes for the SSL setting for both files and assets URL fields but isn't it an overkill? |
The best solution is to use (\Environment::get('ssl') ? 'https://' : 'http://') here too. Because if you allow connections via |
Sounds good! Mixed Content should be prevented by the browser indeed. Finally fixed in 6105550. Can you test and confirm? |
@qzminski that won't work in Contao 4 😁 . Because there the I think you need to do something like this: // Remove relative protocol
if (strpos($strHost, '//') === 0)
{
$strHost = substr($strHost, 2);
}
// Add protocol
if (strpos($strHost, 'http') !== 0)
{
$strHost = (\Environment::get('ssl') ? 'https://' : 'http://') . $strHost;
} |
He trims the |
Ah, I didn't see the |
I don't think it will work in Contao 4 because |
Ah, yeah, you are right. |
Okay that should be it – 336a99a. It works with both formats of CDN URLs |
The extension doesn't seem to respect the values of the files and assets urls entered in the site structure. Is it possible to build the path to the images in regard to the external urls given for files and assets?
The text was updated successfully, but these errors were encountered: