Skip to content

Commit

Permalink
Revert allowedHosts missing value checks (#21923)
Browse files Browse the repository at this point in the history
  • Loading branch information
evantahler authored Jan 26, 2023
1 parent 7f36386 commit ca8151e
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,6 @@ public AllowedHosts getAllowedHosts(AllowedHosts allowedHosts, JsonNode config)
final List<String> hosts = allowedHosts.getHosts();
for (String host : hosts) {
final String replacedString = sub.replace(host);
if (replacedString.contains("${")) {
throw new IOException(
"The allowed host value, '" + host + "', is expecting an interpolation value from the connector's configuration, but none is present");
}
resolvedHosts.add(replacedString);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,23 +42,4 @@ void getAllowedHostsGeneralTest() throws IOException {
assertThat(response.getHosts()).isEqualTo(expected);
}

@Test()
void getAllowedHostsMissingValue() throws IOException {
final AllowedHosts allowedHosts = new AllowedHosts();
final List<String> hosts = new ArrayList();
hosts.add("${subdomain}.vendor.com");
allowedHosts.setHosts(hosts);

final String configJson = "{\"password\": \"abc123\"}";
final JsonNode config = mapper.readValue(configJson, JsonNode.class);

try {
replacer.getAllowedHosts(allowedHosts, config);
throw new RuntimeException("should not get here");
} catch (Exception e) {
assertThat(e).hasMessage(
"The allowed host value, '${subdomain}.vendor.com', is expecting an interpolation value from the connector's configuration, but none is present");
}
}

}

0 comments on commit ca8151e

Please sign in to comment.