[
https://issues.apache.org/jira/browse/CXF-6361?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14505110#comment-14505110
]
Thorben Witt commented on CXF-6361:
-----------------------------------
Okay thanks for the explanation. In my case we have a redirect because of
clustering and it tries to get to the right node. It uses the cookies from the
load balancer and will update it with a clone id (so the URL stays completely
the same).
My understanding for the implementation was, that if the URLs are the same,
then the check with AUTO_REDIRECT_MAX_SAME_URI_COUNT is performed. If the URLs
are different, then it is not a redirect to the same URL.
The check for max redirects is performed elsewhere (see line 1381):
{code:java}
while ((maxRetransmits < 0 || nretransmits < maxRetransmits) &&
processRetransmit()) {
nretransmits++;
}
{code}
There is the check with max retransmits.
> HttpCondiut is not detecting the redirect loop properly
> -------------------------------------------------------
>
> Key: CXF-6361
> URL: https://issues.apache.org/jira/browse/CXF-6361
> Project: CXF
> Issue Type: Bug
> Components: Transports
> Affects Versions: 3.0.4, 2.7.15
> Reporter: Thorben Witt
> Assignee: Sergey Beryozkin
> Labels: easyfix
> Fix For: 3.1.0, 2.7.16, 3.0.5
>
>
> Hi all,
> in the class HTTPConduit is the detection of a redirect. I guess there is a
> slightly problem with the detection, when the URLs are the same:
> Line 1824:
> {code:title=HTTPConduit.java|borderStyle=solid}
> boolean invalidLoopDetected = newURL.equals(lastURL);
> if (!invalidLoopDetected) {
> // this URI was used sometime earlier
> Integer maxSameURICount = PropertyUtils.getInteger(message,
> AUTO_REDIRECT_MAX_SAME_URI_COUNT);
> if (maxSameURICount == null || newURLCount > maxSameURICount)
> {
> invalidLoopDetected = true;
> }
> }
> {code}
> If the URLs are the same (boolean is true), then the if part is not reached
> and the property AUTO_REDIRECT_MAX_SAME_URI_COUNT cannot be used.
> Can you change that? I think the change is just the removal of the not-sign:
> if (invalidLoopDetected) {...}
> Best regards,
> Thorben
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)