Skip to content

Commit

Permalink
Always use localhost for @TestHTTPResource
Browse files Browse the repository at this point in the history
Fixes: #12369
  • Loading branch information
geoand committed Sep 28, 2020
1 parent 64d4587 commit 6366e9a
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,15 @@ public class TestHTTPConfigSourceProvider implements ConfigSourceProvider {

static {
Map<String, String> map = new HashMap<>();
map.put(TEST_URL_KEY, TEST_URL_VALUE);
map.put(TEST_URL_SSL_KEY, TEST_URL_SSL_VALUE);
map.put(TEST_URL_KEY, sanitizeURL(TEST_URL_VALUE));
map.put(TEST_URL_SSL_KEY, sanitizeURL(TEST_URL_SSL_VALUE));
entries = Collections.unmodifiableMap(map);
}

private static String sanitizeURL(String url) {
return url.replace("0.0.0.0", "localhost");
}

public Iterable<ConfigSource> getConfigSources(final ClassLoader forClassLoader) {
return Collections.singletonList(new TestURLConfigSource());
}
Expand Down

0 comments on commit 6366e9a

Please sign in to comment.