Skip to content

Commit d543acc

Browse files
committed
cleanup + comment
1 parent 61b60c1 commit d543acc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/test/java/com/saasquatch/json_schema_inferrer/JsonSchemaInferrerExamplesTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,10 @@ public JsonNode handleEntity(HttpEntity entity) throws IOException {
141141

142142
private static String processGitHubDownloadUrl(String url, String commitHash) {
143143
try {
144+
// Use jsdelivr to speed up the downloads
144145
final String host = new URL(url).getHost();
145146
url = url.replaceFirst(host, "cdn.jsdelivr.net/gh");
146-
url = url.replace('/' + commitHash, '@' + commitHash);
147+
url = url.replaceFirst('/' + commitHash, '@' + commitHash);
147148
return url;
148149
} catch (IOException e) {
149150
throw new UncheckedIOException(e);

0 commit comments

Comments
 (0)