fix(client): return error from rdapQuery when no expiration event found (#1603)
* fix: return error from rdapQuery when no expiration event found When an RDAP response has no expiration event, rdapQuery returned a zero-value ExpirationDate with nil error. This prevented GetDomainExpiration from falling back to WHOIS, causing failures for TLDs like .net where RDAP may omit the expiration event. Signed-off-by: majiayu000 <1835304752@qq.com> * fix: include hostname in RDAP error and add .net domain tests Add .net domain test cases to TestRdapQuery and TestGetDomainExpiration to cover the fallback path when RDAP lacks an expiration event (#1570). Include hostname in the error message for easier debugging. Signed-off-by: majiayu000 <1835304752@qq.com> --------- Signed-off-by: majiayu000 <1835304752@qq.com>
This commit is contained in:
2 files changed
+16
No files matched your search
@@ -528,6 +528,9 @@ func rdapQuery(hostname string) (*whois.Response, error) {
|
||||
break
|
||||
}
|
||||
}
|
||||
if response.ExpirationDate.IsZero() {
|
||||
return nil, fmt.Errorf("no expiration event found in RDAP response for %s", hostname)
|
||||
}
|
||||
return &response, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user