When follow_related=True additionnal related or registration links are searched even if their type is not rdap+json. This may lead to an exception.
However, those links may also contained non JSON endpoint.
For example, the entry https://rdap.centralnic.com/tech/domain/recrut.tech has the following results
"links": [
{
"title": "Authoritative URL for this resource",
"rel": "self",
"type": "application\/rdap+json",
"value": "https://rdap.centralnic.com/tech/domain/recrut.tech",
"href": "https://rdap.centralnic.com/tech/domain/recrut.tech"
},
{
"title": "RDAP Service Help",
"rel": "help",
"type": "text\/html",
"value": "https://rdap.centralnic.com/tech/domain/recrut.tech",
"href": "https://whois.nic.tech/rdap"
},
{
"title": "Dot Tech LLC",
"rel": "related",
"type": "text\/html",
"value": "https://rdap.centralnic.com/tech/domain/recrut.tech",
"href": "http://radixregistry.com"
},
The third entry (Dot Tech LLC) has "rel": "related" however it's type is "type": "text/html"
Consequently, running the following is fine:
whoisit.domain('recrut.tech', follow_related=False)
but when follow_related=True this leads to
raise QueryError(f'Failed to parse RDAP Query response as JSON: {e}', response=error_content) from e
whoisit.errors.QueryError: Failed to parse RDAP Query response as JSON: Expecting value: line 1 column 1 (char 0)
A fix should be to add a condition in the following code to test if the type is application/rdap+json
|
if rel in ('related', 'registration'): |
|
relhref = link.get('href', '') |
|
if relhref: |
If it makes sense, I can make the PR.
When
follow_related=Trueadditionnalrelatedorregistrationlinks are searched even if their type is notrdap+json. This may lead to an exception.However, those links may also contained non JSON endpoint.
For example, the entry https://rdap.centralnic.com/tech/domain/recrut.tech has the following results
The third entry (Dot Tech LLC) has
"rel": "related"however it's type is"type": "text/html"Consequently, running the following is fine:
but when
follow_related=Truethis leads toA fix should be to add a condition in the following code to test if the type is
application/rdap+jsonwhoisit/whoisit/__init__.py
Lines 79 to 81 in 7445e0e
If it makes sense, I can make the PR.