Skip to content

Commit

Permalink
use withUri
Browse files Browse the repository at this point in the history
  • Loading branch information
pstreef committed Sep 23, 2024
1 parent 6694ac9 commit 36b2925
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -788,11 +788,11 @@ MavenRepository normalizeRepository(MavenRepository repository) throws Throwable
if (!originalUrl.equals(httpsUri)) {
reachability = reachable(repository, applyAuthenticationToRequest(repository, request.withMethod(HttpSender.Method.OPTIONS).url(originalUrl)));
if (reachability.isSuccess()) {
return MavenRepository.from(repository, originalUrl);
return repository.withUri(originalUrl);
}
reachability = reachable(repository, applyAuthenticationToRequest(repository, request.withMethod(HttpSender.Method.HEAD).url(originalUrl)));
if (reachability.isReachable()) {
return MavenRepository.from(repository, originalUrl);
return repository.withUri(originalUrl);
}
}
// Won't be null if server is unreachable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,17 +133,6 @@ public MavenRepository(
this.deriveMetadataIfMissing = deriveMetadataIfMissing;
}

public static MavenRepository from(MavenRepository repository, String url) {
return new MavenRepository(
repository.getId(),
url,
repository.getReleases(),
repository.getSnapshots(),
repository.getUsername(),
repository.getPassword(),
repository.getTimeout());
}

public static Builder builder() {
return new Builder();
}
Expand Down

0 comments on commit 36b2925

Please sign in to comment.