You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-dev@jakarta.apache.org by "Pill, Juergen" <Ju...@softwareag.com> on 2001/05/17 15:59:51 UTC

RE: cvs commit: jakarta-slide/src/webdav/server/org/apache/slide/ webdav/method CopyMethod.java MoveMethod.java

There is an addition point, which just came into my mind:

What happens if no port is set. In this case the Host is not stripped
either. Any ideas?

Best regards

Juergen Pill



-----Original Message-----
From: juergen@apache.org [mailto:juergen@apache.org]
Sent: Thursday, May 17, 2001 15:38
To: jakarta-slide-cvs@apache.org
Subject: cvs commit:
jakarta-slide/src/webdav/server/org/apache/slide/webdav/method
CopyMethod.java MoveMethod.java


juergen     01/05/17 06:38:01

  Modified:    src/webdav/server/org/apache/slide/webdav/method
                        CopyMethod.java MoveMethod.java
  Log:
  if the host name was not localhost but rather an alias like xyz, the
hostName was not stripped from the destinationUri, resulting in an incorrect
destUri. It is OPEN to me, what happens if the host in the destUri is not an
alias, but a different host?
  
  Revision  Changes    Path
  1.12      +9 -3
jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/CopyMethod.ja
va
  
  Index: CopyMethod.java
  ===================================================================
  RCS file:
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/Cop
yMethod.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- CopyMethod.java	2001/05/15 11:29:23	1.11
  +++ CopyMethod.java	2001/05/17 13:37:51	1.12
  @@ -1,7 +1,7 @@
   /*
  - * $Header:
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/Cop
yMethod.java,v 1.11 2001/05/15 11:29:23 juergen Exp $
  - * $Revision: 1.11 $
  - * $Date: 2001/05/15 11:29:23 $
  + * $Header:
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/Cop
yMethod.java,v 1.12 2001/05/17 13:37:51 juergen Exp $
  + * $Revision: 1.12 $
  + * $Date: 2001/05/17 13:37:51 $
    *
    * ====================================================================
    *
  @@ -152,6 +152,12 @@
           if ((hostName != null) && (destinationUri.startsWith(hostName)))
{
               destinationUri = destinationUri.substring(hostName.length());
           }
  +        
  +        if (destinationUri.indexOf(":") != (-1)) {
  +            destinationUri =
destinationUri.substring(destinationUri.indexOf(":"));
  +        }
  +            
  +            
           
           if (destinationUri.startsWith(":")) {
               int firstSeparator = destinationUri.indexOf("/");
  
  
  
  1.11      +9 -3
jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/MoveMethod.ja
va
  
  Index: MoveMethod.java
  ===================================================================
  RCS file:
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/Mov
eMethod.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- MoveMethod.java	2001/04/04 16:33:05	1.10
  +++ MoveMethod.java	2001/05/17 13:37:54	1.11
  @@ -1,7 +1,7 @@
   /*
  - * $Header:
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/Mov
eMethod.java,v 1.10 2001/04/04 16:33:05 juergen Exp $
  - * $Revision: 1.10 $
  - * $Date: 2001/04/04 16:33:05 $
  + * $Header:
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/Mov
eMethod.java,v 1.11 2001/05/17 13:37:54 juergen Exp $
  + * $Revision: 1.11 $
  + * $Date: 2001/05/17 13:37:54 $
    *
    * ====================================================================
    *
  @@ -149,6 +149,12 @@
               destinationUri = destinationUri.substring(hostName.length());
           }
           
  +        if (destinationUri.indexOf(":") != (-1)) {
  +            destinationUri =
destinationUri.substring(destinationUri.indexOf(":"));
  +        }
  +            
  +            
  +            
           if (destinationUri.startsWith(":")) {
               int firstSeparator = destinationUri.indexOf("/");
               if (firstSeparator < 0) {
  
  
  

Re: cvs commit: jakarta-slide/src/webdav/server/org/apache/slide/webdav/method CopyMethod.java MoveMethod.java

Posted by "Park, Sung-Gu" <je...@thinkfree.com>.
----- Original Message -----
From: "Pill, Juergen" <Ju...@softwareag.com>
To: <sl...@jakarta.apache.org>; <ja...@apache.org>
Sent: Thursday, May 17, 2001 10:59 PM
Subject: RE: cvs commit:
jakarta-slide/src/webdav/server/org/apache/slide/webdav/method
CopyMethod.java MoveMethod.java


> There is an addition point, which just came into my mind:
>
> What happens if no port is set. In this case the Host is not stripped
> either. Any ideas?

Actually, I think we should match it with the host header.
The rest of the host header would be an absolute path.

> jakarta-slide/src/webdav/server/org/apache/slide/webdav/method
> CopyMethod.java MoveMethod.java
>
>   if the host name was not localhost but rather an alias like xyz, the
> hostName was not stripped from the destinationUri, resulting in an
incorrect
> destUri. It is OPEN to me, what happens if the host in the destUri is not
an
> alias, but a different host?

So, I guess that wouln't be an different host.

Actually, the Request-URI would be http://www.host.com/path or /path.
In case if there are the scheme and authority part, It should be ignored.
Just regarded the same host...  And respected the host header.  ;-)

Sung-Gu

P.S.: In this need, I made the getPath(String) method in the HttpURL class.