[jira] Updated: (HTTPCLIENT-1043) BasicPathHandler match bug

2011-01-14 Thread Oleg Kalnichevski (JIRA)

 [ 
https://issues.apache.org/jira/browse/HTTPCLIENT-1043?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Oleg Kalnichevski updated HTTPCLIENT-1043:
--

Component/s: (was: HttpClient)
 HttpCookie
   Priority: Minor  (was: Critical)

Dmitry

Could you please produce a complete wire log of the HTTP session that exhibits 
the problem? You might also want to add a test case to the HttpClient test 
suite [1] that demonstrates the problem.

Oleg  

[1] 
http://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/cookie/TestCookieRFC2109Spec.java

> BasicPathHandler match bug
> --
>
> Key: HTTPCLIENT-1043
> URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1043
> Project: HttpComponents HttpClient
>  Issue Type: Bug
>  Components: HttpCookie
>Affects Versions: 4.0.1, 4.0.2, 4.0.3, 4.1 Alpha1, 4.1 Alpha2, 4.1 Beta1
>Reporter: Dmitry Grytsovets
>Priority: Minor
> Fix For: 4.1.0, Future
>
>
> in BasicPathHandler
>boolean match = targetpath.startsWith (topmostPath);
> // if there is a match and these values are not exactly the same we 
> have
> // to make sure we're not matcing "/foobar" and "/foo"
> if (match && targetpath.length() != topmostPath.length()) {
> if (!topmostPath.endsWith("/")) {
> match = (targetpath.charAt(topmostPath.length()) == '/');
> }
> }
> must be changed to
>boolean match = topmostPath.startsWith (targetpath);
> // if there is a match and these values are not exactly the same we 
> have
> // to make sure we're not matcing "/foobar" and "/foo"
> if (match && targetpath.length() != topmostPath.length()) {
> if (!targetPath.endsWith("/")) {
> match = (topmostPath.charAt(targetpath.length()-1) == '/');
> }
> }
> example 
> targetpath = "/stat/" // where are you
> topmostPath  = "/stat/domain.tld/" // cookie for path

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


-
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]



[jira] Updated: (HTTPCLIENT-1043) BasicPathHandler match bug

2011-01-14 Thread Dmitry Grytsovets (JIRA)

 [ 
https://issues.apache.org/jira/browse/HTTPCLIENT-1043?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dmitry Grytsovets updated HTTPCLIENT-1043:
--

Description: 
in BasicPathHandler

   boolean match = targetpath.startsWith (topmostPath);
// if there is a match and these values are not exactly the same we have
// to make sure we're not matcing "/foobar" and "/foo"
if (match && targetpath.length() != topmostPath.length()) {
if (!topmostPath.endsWith("/")) {
match = (targetpath.charAt(topmostPath.length()) == '/');
}
}

must be changed to

   boolean match = topmostPath.startsWith (targetpath);
// if there is a match and these values are not exactly the same we have
// to make sure we're not matcing "/foobar" and "/foo"
if (match && targetpath.length() != topmostPath.length()) {
if (!targetPath.endsWith("/")) {
match = (topmostPath.charAt(targetpath.length()-1) == '/');
}
}

example 

targetpath = "/stat/" // where are you
topmostPath  = "/stat/domain.tld/" // cookie for path

  was:
in BasicPathHandler

   boolean match = targetpath.startsWith (topmostPath);
// if there is a match and these values are not exactly the same we have
// to make sure we're not matcing "/foobar" and "/foo"
if (match && targetpath.length() != topmostPath.length()) {
if (!topmostPath.endsWith("/")) {
match = (targetpath.charAt(topmostPath.length()) == '/');
}
}

must be changed to

   boolean match = topmostPath.startsWith (targetpath);
// if there is a match and these values are not exactly the same we have
// to make sure we're not matcing "/foobar" and "/foo"
if (match && targetpath.length() != topmostPath.length()) {
if (!topmostPath.endsWith("/")) {
match = (topmostPath.charAt(targetpath.length()) == '/');
}
}

example 

targetpath = "/stat/" // where are you
topmostPath  = "/stat/domain.tld/" // cookie for path


> BasicPathHandler match bug
> --
>
> Key: HTTPCLIENT-1043
> URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1043
> Project: HttpComponents HttpClient
>  Issue Type: Bug
>  Components: HttpClient
>Affects Versions: 4.0.1, 4.0.2, 4.0.3, 4.1 Alpha1, 4.1 Alpha2, 4.1 Beta1
>Reporter: Dmitry Grytsovets
>Priority: Critical
> Fix For: 4.1.0, Future
>
>
> in BasicPathHandler
>boolean match = targetpath.startsWith (topmostPath);
> // if there is a match and these values are not exactly the same we 
> have
> // to make sure we're not matcing "/foobar" and "/foo"
> if (match && targetpath.length() != topmostPath.length()) {
> if (!topmostPath.endsWith("/")) {
> match = (targetpath.charAt(topmostPath.length()) == '/');
> }
> }
> must be changed to
>boolean match = topmostPath.startsWith (targetpath);
> // if there is a match and these values are not exactly the same we 
> have
> // to make sure we're not matcing "/foobar" and "/foo"
> if (match && targetpath.length() != topmostPath.length()) {
> if (!targetPath.endsWith("/")) {
> match = (topmostPath.charAt(targetpath.length()-1) == '/');
> }
> }
> example 
> targetpath = "/stat/" // where are you
> topmostPath  = "/stat/domain.tld/" // cookie for path

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


-
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]