Issue Bug Closed

#90933AssetCollector does not allow protocol-relative URLs

Jonas Eberle 04/02/20, 17:30 updated 04/21/20, 10:42

Description

In PageRenderer, this

page.includeJSFooter.gmaps = //maps.googleapis.com/maps/api/js
page.includeJSFooter.gmaps.external = 1

would be output as expected.

In AssetCollector, this

<f:asset.script identifier="gmaps" src="//maps.googleapis.com/maps/api/js" />

would lead to TYPO3 trying to build a local URL.

IMHO it could either be documented as unsupported (because hardly needed nowadays) or hardened a bit in this part:
https://github.com/TYPO3/TYPO3.CMS/blob/master/typo3/sysext/core/Classes/Page/AssetRenderer.php#L93

Protocol-relative:
https://en.wikipedia.org/wiki/URL#prurl

Rather unneeded:
https://stackoverflow.com/questions/28446314/why-use-protocol-relative-urls-at-all

Reviews 1