You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by dima <di...@hyperfluid.com> on 2000/10/04 19:33:45 UTC

[C2] minor bug in CocoonServlet.java

Hi everyone,

 recently built Cocoon 2.0a3 from CVS and discovered a little bug

 this.cocoon.process (env) returned false because in
org.apache.cocoon.Cocoon.java because of a little bug in
org.apache.cocoon.servlet.CocoonServlet.java (:276):
_________________________________________________________________

        // We got it... Process the request
        String uri =  req.getServletPath();
        String pathInfo = req.getPathInfo();
        if (pathInfo != null) uri += "/" + pathInfo; <== here

        if (!uri.equals("")) {
            try {
                if (uri.charAt(0) == '/') {
                    uri = uri.substring(1);
                }
        and it should be :

	if (pathInfo != null) uri += pathInfo;

	when I sent req.getServletPath () and req.getPathInfo () to debug
output
	req.getServletPath () returned null and req.getPathInfo () return "/"

	so the original "if (pathInfo != null) uri += "/" + pathInfo;" was
producing
	a path with "//" in it.

hope this helps,
cheers,
dima

Re: [C2] minor bug in CocoonServlet.java

Posted by Stefano Mazzocchi <st...@apache.org>.
dima wrote:
> 
> Hi everyone,
> 
>  recently built Cocoon 2.0a3 from CVS and discovered a little bug
> 
>  this.cocoon.process (env) returned false because in
> org.apache.cocoon.Cocoon.java because of a little bug in
> org.apache.cocoon.servlet.CocoonServlet.java (:276):
> _________________________________________________________________
> 
>         // We got it... Process the request
>         String uri =  req.getServletPath();
>         String pathInfo = req.getPathInfo();
>         if (pathInfo != null) uri += "/" + pathInfo; <== here
> 
>         if (!uri.equals("")) {
>             try {
>                 if (uri.charAt(0) == '/') {
>                     uri = uri.substring(1);
>                 }
>         and it should be :
> 
>         if (pathInfo != null) uri += pathInfo;
> 
>         when I sent req.getServletPath () and req.getPathInfo () to debug
> output
>         req.getServletPath () returned null and req.getPathInfo () return "/"
> 
>         so the original "if (pathInfo != null) uri += "/" + pathInfo;" was
> producing
>         a path with "//" in it.

you are totally right.

My fault. I'm patching right away.

Thanks much.

-- 
Stefano Mazzocchi      One must still have chaos in oneself to be
                          able to give birth to a dancing star.
<st...@apache.org>                             Friedrich Nietzsche
--------------------------------------------------------------------
 Missed us in Orlando? Make it up with ApacheCON Europe in London!
------------------------- http://ApacheCon.Com ---------------------