Classes/Service/UriService.php
protected function recreateUriPath($uri): string
    {
        $objectManager = new ObjectManager();
        /** @var UriBuilder $uriBuilder */
        $uriBuilder = $objectManager->get(UriBuilder::class);
        if (null === ObjectAccess::getProperty($uriBuilder, 'contentObject', true)) {
            // there are situations without a valid contentObject in the URI builder
            // prevent this situation by return the original request URI
            return $uri;
        }
        $url = $uriBuilder->reset()
            ->setAddQueryString(true)
            ->setCreateAbsoluteUri(true)
            ->build();

        $parts = (array)\parse_url($url);
        $unset = ['scheme', 'user', 'pass', 'host', 'port'];
        foreach ($unset as $u) {
            unset($parts[$u]);
        }

        return HttpUtility::buildUrl($parts);
    }
protected function recreateUriPath($uri): string
    {
        $objectManager = new ObjectManager();
        /** @var UriBuilder $uriBuilder */
        $uriBuilder = $objectManager->get(UriBuilder::class);
        if (null === ObjectAccess::getProperty($uriBuilder, 'contentObject', true)) {
            // there are situations without a valid contentObject in the URI builder
            // prevent this situation by return the original request URI
            return $uri;
        }
        $url = $uriBuilder->reset()
            ->setAddQueryString(true)
            ->setCreateAbsoluteUri(true)
            ->build();

        $parts = (array)\parse_url($url);
        $unset = ['scheme', 'user', 'pass', 'host', 'port'];
        foreach ($unset as $u) {
            unset($parts[$u]);
        }

        return HttpUtility::buildUrl($parts);
    }
protected function recreateUriPath ( $ uri ) : string { $ objectManager = new ObjectManager ( ) ; /** @var UriBuilder $uriBuilder */ $ uriBuilder = $ objectManager -> get ( UriBuilder :: class ) ; if ( null === ObjectAccess :: getProperty ( $ uriBuilder , 'contentObject' , true ) ) { // there are situations without a valid contentObject in the URI builder // prevent this situation by return the original request URI return $ uri ; } $ url = $ uriBuilder -> reset ( ) -> setAddQueryString ( true ) -> setCreateAbsoluteUri ( true ) -> build ( ) ; $ parts = ( array ) \ parse_url ( $ url ) ; $ unset = [ 'scheme' , 'user' , 'pass' , 'host' , 'port' ] ; foreach ( $ unset as $ u ) { unset ( $ parts [ $ u ] ) ; } return HttpUtility :: buildUrl ( $ parts ) ; }
Recreates the URI of the current request.

Especially in simulateStaticDocument context, the different URIs lead to the same result
and static file caching would store the wrong URI that was used in the first request to
the website (e.g. "TheGoodURI.13.0.html" is as well accepted as "TheFakeURI.13.0.html")

@param string $uri

@return string The recreated URI of the current request
Recreates the URI of the current request .