core-bundle/src/Asset/ContaoContext.php
public function getBasePath(): string
    {
        if ($this->debug) {
            return '';
        }

        $request = $this->requestStack->getCurrentRequest();

        if (null === $request || '' === ($staticUrl = $this->getFieldValue($this->getPageModel()))) {
            return '';
        }

        $protocol = $this->isSecure() ? 'https' : 'http';
        $relative = preg_replace('@https?://@', '', $staticUrl);

        return sprintf('%s://%s%s', $protocol, $relative, $request->getBasePath());
    }
public function getBasePath(): string
    {
        if ($this->debug) {
            return '';
        }

        $request = $this->requestStack->getCurrentRequest();

        if (null === $request || '' === ($staticUrl = $this->getFieldValue($this->getPageModel()))) {
            return '';
        }

        $protocol = $this->isSecure() ? 'https' : 'http';
        $relative = preg_replace('@https?://@', '', $staticUrl);

        return sprintf('%s://%s%s', $protocol, $relative, $request->getBasePath());
    }
{@inheritdoc}