You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Call request->getRemoteHost() can cause to stuck app #218
Call $request->getRemoteHost() can stuck app, because remote host cane be unreacheable by reverse DNS or can have too long response.
Steps To Reproduce
useNette\Http\Request;
$request = newRequest(
newUrl('http://example.com'),
[],
[],
[],
[],
[],
'1.0.32.12', // some IP from location with slow reachability (china for example)null
);
$request->getRemoteHost(); // this can to solve too long
Problem 2: Here is no way to force set null value to Request::$remoteHost and get it – it always call internally gethostbyaddr() function.
Expected Behavior
Request should by only dataobject without using any data from external source (DNS server).
The getter getRemoteHost() is also called when I need to modify Request object, for example:
Usually is Request object filled by RequestFactory and getters just only response. Looks good to trust Request::$remoteHost filled from RequestFactory and don't try to fetch it (here/again) from external source.
Activity
dg commentedon Nov 8, 2022
Probably the best solution would be to deprecate getRemoteHost().
IRequest::getRemoteHost() is silently deprecated (#218)
IRequest::getRemoteHost() is silently deprecated (#218)
IRequest::getRemoteHost() is silently deprecated (#218)
IRequest::getRemoteHost() is silently deprecated (#218)
IRequest::getRemoteHost() is silently deprecated (#218)
IRequest::getRemoteHost() is silently deprecated (#218)
IRequest::getRemoteHost() is silently deprecated (#218)
IRequest::getRemoteHost() is silently deprecated (#218)
IRequest::getRemoteHost() is silently deprecated (#218)
Revert "IRequest::getRemoteHost() is silently deprecated (#218)"
jakubboucek commentedon Dec 4, 2022
@dg Díky! ❤️
Request::getRemoteHost() does not perform DNS resolving [Closes #218]
Request::getRemoteHost() does not perform DNS resolving [Closes #218]
40 remaining items
Request::getRemoteHost() does not perform DNS resolving [Closes #218]
Request::getRemoteHost() does not perform DNS resolving [Closes #218]
Request::getRemoteHost() does not perform DNS resolving [Closes #218]
Request::getRemoteHost() does not perform DNS resolving [Closes #218]
Request::getRemoteHost() does not perform DNS resolving [Closes #218]
Request::getRemoteHost() does not perform DNS resolving [Closes #218]
Request::getRemoteHost() does not perform DNS resolving [Closes #218]
Request::getRemoteHost() is deprecated and returns null [Closes #218]
Request::getRemoteHost() is deprecated and returns null [Closes #218]
Request::getRemoteHost() is deprecated and returns null [Closes #218]
Request::getRemoteHost() is deprecated and returns null [Closes #218]
Request::getRemoteHost() is deprecated and returns null [Closes #218]
Request::getRemoteHost() is deprecated and returns null [Closes #218]
Request::getRemoteHost() is deprecated and returns null [Closes #218]
Request::getRemoteHost() is deprecated and returns null [Closes #218]