Problem/Motivation
When building routed Urls, you're able to set the option absolute
to TRUE
, and set the base_url
option. When assembling the URL, this will result in the specified base URL being used in the URL.
But this option doesn't work for unrouted URLs. We should probably make this behavior consistent.
Steps to reproduce
This will work for a routed URL:drush php:eval "echo \Drupal\Core\Url::fromUri('internal:/', ['absolute' => 1, 'base_url' => 'https://test.com'])->toString();"
will return https://test.com/
But it won't work for unrouted URLs:drush php:eval "echo \Drupal\Core\Url::fromUri('internal:/404', ['absolute' => 1, 'base_url' => 'https://test.com'])->toString();"
will return https://your-local-domain/404
Proposed resolution
Adjust UnroutedUrlAssembler to take into account the base_url
option.