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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When the first to-be-discovered url returning a response type of redirection, it will increase the currentHop until it reaches
AutodiscoverMaxRedirections
, then if next to-be-discovered url (not from redirection) has a redirection url, the new redirection url will not get through the system since the current hop has reached max, this fix will make a copy from the original urls fromgetAutodiscoverServiceUrls
and check if the new to-be-discovered url is from this origin, then it will reset current hop if so.Aslo, changed the
urls.add
method tourls.set
for not increasing the urls' list size with a lot of dummy urls ( e.g. if detecting a new redirect url, it will add the redirect target to current index and continue with the current index, however the old url will be shifted to next index so when the next index of url being discovered, it will do the same loop until hitting theAutodiscoverMaxRedirections
), this will decrease the number of requests that fetching unnecessary urls and increase performance.