mirror of
https://github.com/google/nomulus
synced 2026-02-04 03:52:33 +00:00
Conform to RDAP Technical Implementation Guide
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=251864499
This commit is contained in:
@@ -47,6 +47,8 @@ public class RdapDomainAction extends RdapActionBase {
|
||||
|
||||
@Override
|
||||
public RdapDomain getJsonObjectForResource(String pathSearchString, boolean isHeadRequest) {
|
||||
// RDAP Technical Implementation Guide 2.1.1 - we must support A-label (Punycode) and U-label
|
||||
// (Unicode) formats. canonicalizeName will transform Unicode to Punycode so we support both.
|
||||
pathSearchString = canonicalizeName(pathSearchString);
|
||||
try {
|
||||
validateDomainName(pathSearchString);
|
||||
@@ -62,7 +64,12 @@ public class RdapDomainAction extends RdapActionBase {
|
||||
DomainBase.class,
|
||||
pathSearchString,
|
||||
shouldIncludeDeleted() ? START_OF_TIME : rdapJsonFormatter.getRequestTime());
|
||||
if (!shouldBeVisible(domainBase)) {
|
||||
if (!domainBase.isPresent() || !isAuthorized(domainBase.get())) {
|
||||
// RFC7480 5.3 - if the server wishes to respond that it doesn't have data satisfying the
|
||||
// query, it MUST reply with 404 response code.
|
||||
//
|
||||
// Note we don't do RFC7480 5.3 - returning a different code if we wish to say "this info
|
||||
// exists but we don't want to show it to you", because we DON'T wish to say that.
|
||||
throw new NotFoundException(pathSearchString + " not found");
|
||||
}
|
||||
return rdapJsonFormatter.createRdapDomain(domainBase.get(), OutputDataType.FULL);
|
||||
|
||||
Reference in New Issue
Block a user