-
Notifications
You must be signed in to change notification settings - Fork 117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect handling of domain free response of .nl whois #138
Comments
Note:
|
@io-developer Can you please guide me where I should look to fix it, so I can create a PR? My issue is the same like mentioned in #132 (comment) I assume that we need to build something that will throw an exception when the "text" matches a specific text (like maximum number of requests per second exceeded) |
Should we create a new Tld\Parser? To handle "error codes", and then throw exception? |
At the moment a check is done on validateResponse method on loaders:
but the regular expression probably refers to the message of a single TLD, it should be extended to handle more cases of whois servers error messages, quite precisely to avoid false positives. There are some regexps in the json and others in the PHP code, a more complete refactoring should put them all in one place, but IMHO that's too much work given the few developers on the project. |
PHP-Whois version: 4.0.0
PHP version: 7.4.13
Description
I'm searching if a .nl domain is free, and php-whois isn't able to correctly tell me if it's free. The things I observe is that when you too often do a whois request, the server response with "you have reached the limit of requests per second" (not the exact text), php-whois will return
null
when doing$whois->loadDomainInfo('notanexistingdomain.nl')
. But it also returnsnull
when the domain is free.Also it will always do two requests to the whoisAPI, one with $query
notanexistingdomain.nl
and the second one with=notanexistingdomain.nl
The API returns
notexistingnldomain.nl is free
on the first request, and then the second request (which is initiated from https://github.com/io-developer/php-whois/blob/master/src/Iodev/Whois/Modules/Tld/TldModule.php#L210) with $query=notanexistingdomain.nl
which get the response of the APIError: invalid domain name
How to reproduce
$result = $whois->loadDomainInfo('notanexistingdomain.nl')
. It should not return null, and it should not execute 2 requests (aka should not come here https://github.com/io-developer/php-whois/blob/master/src/Iodev/Whois/Modules/Tld/TldModule.php#L210)The text was updated successfully, but these errors were encountered: