cmlenz      02/03/16 09:35:59

  Modified:    src/webdav/client/src/org/apache/webdav/lib/methods Tag:
                        SLIDE_1_0 CopyMethod.java MoveMethod.java
  Log:
  Porting bugfixes/enhancements from the HEAD branch:
  - Committed by dirkv, 01/11/18 10:29:52
    "scheme in included in the host parameter"
  - Committed by juergen, 02/01/28 05:09:05
    "the host should not contain the protocol, IMO, but the target header
     must. following changes:
     1) added new method generateHeaders(boolean httpsRequired, String host,
        State state), all other are deprecated now.
     2) copy- and move-method use the flag to create the target header, all
        other webdav methods still use the old implementation.
     please see recent e-mail too [Slide and mod-dav]
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.13.2.1  +12 -7     
jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/methods/CopyMethod.java
  
  Index: CopyMethod.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/methods/CopyMethod.java,v
  retrieving revision 1.13
  retrieving revision 1.13.2.1
  diff -u -r1.13 -r1.13.2.1
  --- CopyMethod.java   1 May 2001 21:28:02 -0000       1.13
  +++ CopyMethod.java   16 Mar 2002 17:35:59 -0000      1.13.2.1
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/methods/CopyMethod.java,v
 1.13 2001/05/01 21:28:02 remm Exp $
  - * $Revision: 1.13 $
  - * $Date: 2001/05/01 21:28:02 $
  + * $Header: 
/home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/methods/CopyMethod.java,v
 1.13.2.1 2002/03/16 17:35:59 cmlenz Exp $
  + * $Revision: 1.13.2.1 $
  + * $Date: 2002/03/16 17:35:59 $
    *
    * ====================================================================
    *
  @@ -213,15 +213,20 @@
       /**
        * Generate additional headers needed by the request.
        *
  +     * @param httpsRequired true, if the protocol is https, else http
        * @param host the host
        * @param state State token
        */
  -    public void generateHeaders(String host, State state) {
  +    public void generateHeaders(boolean httpsRequired, String host, State state) {
   
           super.generateHeaders(host, state);
  -
  -        String absoluteDestination = "http://"; + host
  -            + state.URLEncode(destination);
  +        
  +        String protocol;
  +        if (httpsRequired) protocol = "https://";;
  +        else               protocol = "http://";;
  +        String absoluteDestination =
  +            protocol + host + state.URLEncode(destination);
  +        
   
           super.setHeader("Destination", absoluteDestination);
           if (!isOverwrite())
  
  
  
  1.13.2.1  +10 -6     
jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/methods/MoveMethod.java
  
  Index: MoveMethod.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/methods/MoveMethod.java,v
  retrieving revision 1.13
  retrieving revision 1.13.2.1
  diff -u -r1.13 -r1.13.2.1
  --- MoveMethod.java   1 May 2001 21:28:02 -0000       1.13
  +++ MoveMethod.java   16 Mar 2002 17:35:59 -0000      1.13.2.1
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/methods/MoveMethod.java,v
 1.13 2001/05/01 21:28:02 remm Exp $
  - * $Revision: 1.13 $
  - * $Date: 2001/05/01 21:28:02 $
  + * $Header: 
/home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/methods/MoveMethod.java,v
 1.13.2.1 2002/03/16 17:35:59 cmlenz Exp $
  + * $Revision: 1.13.2.1 $
  + * $Date: 2002/03/16 17:35:59 $
    *
    * ====================================================================
    *
  @@ -212,15 +212,19 @@
       /**
        * Generate additional headers needed by the request.
        *
  +     * @param httpsRequired true, if the protocol is https, else http
        * @param host the host
        * @param state State token
        */
  -    public void generateHeaders(String host, State state) {
  +    public void generateHeaders(boolean httpsRequired, String host, State state) {
   
           super.generateHeaders(host, state);
   
  -        String absoluteDestination = "http://"; + host
  -            + state.URLEncode(destination);
  +        String protocol;
  +        if (httpsRequired) protocol = "https://";;
  +        else               protocol = "http://";;
  +        String absoluteDestination =
  +            protocol + host + state.URLEncode(destination);
   
           super.setHeader("Destination", absoluteDestination);
           if (!isOverwrite())
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to