Nette\Http\RequestFactory.php gives “TypeError: trim() expects parameter 1 to be string, bool given”

Member | 11

I am migrating from 2.4 to 3.0 and I have problem with settings of http.proxy

For example here it test:

test(function () {
	$_SERVER = [
		'REMOTE_ADDR' => '',

	$factory = new RequestFactory();

	Assert::same('', $factory->fromGlobals()->getRemoteAddress()); // here I am not sure if I expect right IP

And this fails with TypeError: trim() expects parameter 1 to be string, bool given on line:…tFactory.php#L336

Could anyone help me? I am not sure if everything in Nette\Http is ok and fail is on my side or this is real bug in Nette\Http. And if this is bug I am not sure what should return.

If you send me anything what I should read/watch to better understand this I would be more than happy:)


Member | 3616

With this code you are saying that mentioned ips are all proxies. So Nette cannot tell you the client’s ip.