nette/http

Url::getAbsoluteUrl() has unexpected output - missing // in scheme

Closed this issue · 4 comments

Hi, i am not sure, this just might be undocumented BC break (i was not able to find it in changelog) or we are doing something wrong.

Version: >=3.0.0

Bug Description

Following code worked in 2.4.11, but in 3.0.2 has output glamitrends:products which obviously is not valid url address.

$url = new Nette\Http\Url();
$url->setScheme('glamitrends');
$url->setPath('products');

Assert($url->getAbsoluteUrl() === 'glamitrends://products');

Expected Behavior

$url->getAbsoluteUrl() output to be glamitrends://products'

This workaround (code change) seems to be working for us:

$url = new Nette\Http\Url('glamitrends://products');

In glamitrends://products, the products part is a hostname, not a path.

dg commented

It was broken in 2.4 (fix 8ffa1cd)

Ok, thank you for explaining. I understand it that way, we were exploiting a bug, thinking it is a feature and since it was fixed it no longer works for us 😄