Skip to content

Commit

Permalink
Fix: AutodiscoverService has no timeout, and thus might hang indefini…
Browse files Browse the repository at this point in the history
…tely.
  • Loading branch information
bcthom09 authored and André Behrens committed Dec 9, 2015
1 parent 764f0dd commit ea8f81a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,7 @@ private URI getRedirectUrl(String domainName)

request.setRequestMethod("GET");
request.setAllowAutoRedirect(false);
request.setTimeout(getTimeout());

// Do NOT allow authentication as this single request will be made over plain HTTP.
request.setAllowAuthentication(false);
Expand Down Expand Up @@ -1523,6 +1524,7 @@ private boolean tryGetEnabledEndpointsForHost(String host,
request.setAllowAutoRedirect(false);
request.setPreAuthenticate(false);
request.setUseDefaultCredentials(this.getUseDefaultCredentials());
request.setTimeout(getTimeout());

prepareCredentials(request);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3607,7 +3607,8 @@ private URI getAutodiscoverUrl(String emailAddress,

AutodiscoverService autodiscoverService = new AutodiscoverService(this, requestedServerVersion);
autodiscoverService.setWebProxy(getWebProxy());

autodiscoverService.setTimeout(getTimeout());

autodiscoverService
.setRedirectionUrlValidationCallback(validateRedirectionUrlCallback);
autodiscoverService.setEnableScpLookup(this.getEnableScpLookup());
Expand Down

0 comments on commit ea8f81a

Please sign in to comment.