Skip to content
This repository has been archived by the owner on Jun 18, 2024. It is now read-only.

Fixes autodiscover max redirection from multi-origin #541

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,7 @@ TSettings internalGetLegacyUserSettings(
int scpUrlCount;
OutParam<Integer> outParamInt = new OutParam<Integer>();
List<URI> urls = this.getAutodiscoverServiceUrls(domainName, outParamInt);
List<URI> origUrls = new ArrayList<URI>(urls);
scpUrlCount = outParamInt.getParam();
if (urls.size() == 0) {
throw new ServiceValidationException(
Expand All @@ -570,6 +571,9 @@ TSettings internalGetLegacyUserSettings(

do {
URI autodiscoverUrl = urls.get(currentUrlIndex);
if (origUrls.contains(autodiscoverUrl)) {
currentHop.setParam(1);
}
boolean isScpUrl = currentUrlIndex < scpUrlCount;

try {
Expand Down Expand Up @@ -601,7 +605,7 @@ TSettings internalGetLegacyUserSettings(
settings
.getRedirectTarget()));

urls.add(currentUrlIndex, new URI(
urls.set(currentUrlIndex, new URI(
settings.getRedirectTarget()));

break;
Expand Down