Commit da6ea8d7f41857ca074a1f596b5649579a75e040

Authored by Kevin G Fourie
1 parent 4a4e3483

Working on fix to get Finder working for creating files via WebDAV.

ktwebdav/lib/KTWebDAVServer.inc.php
@@ -346,26 +346,26 @@ class KTWebDAVServer extends HTTP_WebDAV_Server @@ -346,26 +346,26 @@ class KTWebDAVServer extends HTTP_WebDAV_Server
346 // are sent in the response without any message-body 346 // are sent in the response without any message-body
347 $method = 'get'; 347 $method = 'get';
348 } 348 }
349 - $this->ktwebdavLog("Entering $method request", 'info', true);  
350 -  
351 - if (method_exists($this, $wrapper) && ($method == 'options' || method_exists($this, $method))) {  
352 - $this->$wrapper(); // call method by name  
353 - } else { // method not found/implemented or needs to be ignored for now  
354 - if (($_SERVER['REQUEST_METHOD'] == 'LOCK') || ($_SERVER['REQUEST_METHOD'] == 'UNLOCK')) {  
355 - //$this->http_status('412 Precondition failed');  
356 - // This is to get Finder to work for now.  
357 - $this->ktwebdavLog("Skipping $method request", 'info', true);  
358 - $this->http_status("200 OK") ;  
359 - } else {  
360 - $this->http_status('405 Method not allowed');  
361 - header('Allow: '.join(', ', $this->_allow())); // tell client what's allowed  
362 - }  
363 - }  
364 -  
365 - $this->ktwebdavLog("Exiting $method request", 'info', true); 349 + // stub out lock and unlock to get Finder working
  350 + if (($method == 'lock') || ($method == 'unlock')) {
  351 + $this->ktwebdavLog("Skipping $method request", 'info', true);
  352 + $this->http_status("200 OK");
  353 + } else {
  354 + $this->ktwebdavLog("Entering $method request", 'info', true);
366 355
367 - } 356 + if (method_exists($this, $wrapper) && ($method == 'options' || method_exists($this, $method))) {
  357 + $this->$wrapper(); // call method by name
  358 + } else { // method not found/implemented
  359 + if ($_SERVER['REQUEST_METHOD'] == 'LOCK') {
  360 + $this->http_status('412 Precondition failed');
  361 + } else {
  362 + $this->http_status('405 Method not allowed');
  363 + header('Allow: '.join(', ', $this->_allow())); // tell client what's allowed
  364 + }
  365 + }
368 366
  367 +$this->ktwebdavLog("Exiting $method request", 'info', true);
  368 +}
369 369
370 /** 370 /**
371 * check authentication if check is implemented 371 * check authentication if check is implemented