cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sergey Beryozkin (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CXF-6361) HttpCondiut is not detecting the redirect loop properly
Date Tue, 21 Apr 2015 12:39:59 GMT

    [ https://issues.apache.org/jira/browse/CXF-6361?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14504881#comment-14504881
] 

Sergey Beryozkin commented on CXF-6361:
---------------------------------------

The original code is actually correct: if we have a redirect with identical URIs following
one another then it is an error and the max redirect property is not supported.  But it it
is a redirect and the conduit knows it happened before, example, a-b-a, with 'a' being the
last redirect, then if the max redirect property is set, say to 3, then the invocation will
continue.
Hope it clarifies it.

Do you really need supporting an auto-redirect on the same URI for a limited number of times
?



> 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)

Mime
View raw message