Commit 4a4e3483a83dcca6150385f30b78976a9c3a33bd

Authored by Kevin G Fourie
1 parent 8105451c

Added fix to get Finder working for creating files via WebDAV.

Thanks Robert A. Lerche!
ktwebdav/lib/KTWebDAVServer.inc.php
... ... @@ -350,9 +350,12 @@ class KTWebDAVServer extends HTTP_WebDAV_Server
350 350  
351 351 if (method_exists($this, $wrapper) && ($method == 'options' || method_exists($this, $method))) {
352 352 $this->$wrapper(); // call method by name
353   - } else { // method not found/implemented
354   - if ($_SERVER['REQUEST_METHOD'] == 'LOCK') {
355   - $this->http_status('412 Precondition failed');
  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") ;
356 359 } else {
357 360 $this->http_status('405 Method not allowed');
358 361 header('Allow: '.join(', ', $this->_allow())); // tell client what's allowed
... ... @@ -368,7 +371,7 @@ class KTWebDAVServer extends HTTP_WebDAV_Server
368 371 * check authentication if check is implemented
369 372 *
370 373 * @param void
371   - * @return bool true if authentication succeded or not necessary
  374 + * @return bool true if authentication succeeded or not necessary
372 375 */
373 376 function _check_auth()
374 377 {
... ...