diff --git a/core/src/main/java/google/registry/tmch/NordnVerifyAction.java b/core/src/main/java/google/registry/tmch/NordnVerifyAction.java index c2e22148e..fe6c2b696 100644 --- a/core/src/main/java/google/registry/tmch/NordnVerifyAction.java +++ b/core/src/main/java/google/registry/tmch/NordnVerifyAction.java @@ -64,7 +64,7 @@ public final class NordnVerifyAction implements Runnable { static final String NORDN_URL_PARAM = "nordnUrl"; static final String NORDN_LOG_ID_PARAM = "nordnLogId"; - private static final String MARKSDB_URL_BEGINNING = "ry.marksdb.org"; + private static final String MARKSDB_HOST_NAME = "ry.marksdb.org"; private static final FluentLogger logger = FluentLogger.forEnclosingClass(); @@ -109,11 +109,7 @@ public final class NordnVerifyAction implements Runnable { @VisibleForTesting LordnLog verify() throws IOException, GeneralSecurityException { String host = Ascii.toLowerCase(url.getHost()); - checkArgument( - host.startsWith(MARKSDB_URL_BEGINNING), - "URL %s must start with %s", - url, - MARKSDB_URL_BEGINNING); + checkArgument(host.equals(MARKSDB_HOST_NAME), "Host %s must equal %s", host, MARKSDB_HOST_NAME); logger.atInfo().log("LORDN verify task %s: Sending request to URL %s", actionLogId, url); HttpURLConnection connection = urlConnectionService.createConnection(url); lordnRequestInitializer.initialize(connection, tld); diff --git a/core/src/test/java/google/registry/tmch/NordnVerifyActionTest.java b/core/src/test/java/google/registry/tmch/NordnVerifyActionTest.java index 3dc20efa8..c8870a937 100644 --- a/core/src/test/java/google/registry/tmch/NordnVerifyActionTest.java +++ b/core/src/test/java/google/registry/tmch/NordnVerifyActionTest.java @@ -170,9 +170,7 @@ class NordnVerifyActionTest { void testFailure_badUrl() throws Exception { action.url = URI.create("http://example.com/blobio").toURL(); IllegalArgumentException thrown = assertThrows(IllegalArgumentException.class, action::run); - assertThat(thrown) - .hasMessageThat() - .isEqualTo("URL http://example.com/blobio must start with ry.marksdb.org"); + assertThat(thrown).hasMessageThat().isEqualTo("Host example.com must equal ry.marksdb.org"); } @Test