소스 검색

prepare Cryptomator to eventually change the update check URL

Sebastian Stenzel 3 년 전
부모
커밋
120be431ee
1개의 변경된 파일3개의 추가작업 그리고 1개의 파일을 삭제
  1. 3 1
      src/main/java/org/cryptomator/ui/fxapp/UpdateCheckerModule.java

+ 3 - 1
src/main/java/org/cryptomator/ui/fxapp/UpdateCheckerModule.java

@@ -43,7 +43,9 @@ public abstract class UpdateCheckerModule {
 	@FxApplicationScoped
 	static Optional<HttpClient> provideHttpClient() {
 		try {
-			return Optional.of(HttpClient.newHttpClient());
+			return Optional.of(HttpClient.newBuilder() //
+					.followRedirects(HttpClient.Redirect.NORMAL) // from version 1.6.11 onwards, Cryptomator can follow redirects, in case this URL ever changes
+					.build());
 		} catch (UncheckedIOException e) {
 			LOG.error("HttpClient for update check cannot be created.", e);
 			return Optional.empty();