[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    branches/KDE/3.5/kdelibs/kioslave/http
From:       Hamish Rodda <rodda () kde ! org>
Date:       2006-01-03 10:35:18
Message-ID: 1136284518.094207.19111.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 493783 by rodda:

Work around Apache2 DAV module's insistence on trailing slashes at the
end of requests on directories.

BUG:119066


 M  +26 -0     http.cc  
 M  +1 -0      http.h  


--- branches/KDE/3.5/kdelibs/kioslave/http/http.cc #493782:493783
@@ -259,6 +259,7 @@
 void HTTPProtocol::resetResponseSettings()
 {
   m_bRedirect = false;
+  m_redirectLocation = KURL();
   m_bChunked = false;
   m_iSize = NO_SIZE;
 
@@ -1366,6 +1367,30 @@
 
   retrieveHeader( false );
 
+  if ( m_responseCode == 301 )
+  {
+    kdDebug(7113) << "(" << m_pid << ") HTTPProtocol::re-rename " << m_redirectLocation.path() << endl;
+    // Work around strict Apache-2 WebDAV implementation which refuses to cooperate
+    // with webdav://host/directory, instead requiring webdav://host/directory/
+    if (m_redirectLocation.protocol() == "https")
+      m_redirectLocation.setProtocol("webdavs");
+    else
+      m_redirectLocation.setProtocol("webdav");
+
+    if ( !checkRequestURL( m_redirectLocation ) )
+      return;
+
+    m_request.method = DAV_MOVE;
+    m_request.path = m_redirectLocation.path();
+    m_request.davData.desturl = newDest.url();
+    m_request.davData.overwrite = overwrite;
+    m_request.query = QString::null;
+    m_request.cache = CC_Reload;
+    m_request.doProxy = m_bUseProxy;
+
+    retrieveHeader( false );
+  }
+
   if ( m_responseCode == 201 )
     davFinished();
   else
@@ -3561,6 +3586,7 @@
       return false;
     }
     m_bRedirect = true;
+    m_redirectLocation = u;
 
     if (!m_request.id.isEmpty())
     {
--- branches/KDE/3.5/kdelibs/kioslave/http/http.h #493782:493783
@@ -476,6 +476,7 @@
 
 //--- Settings related to a single response only
   QStringList m_responseHeader; // All headers
+  KURL m_redirectLocation;
   bool m_bRedirect; // Indicates current request is a redirection
 
   // Processing related
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic