Project

General

Profile

Custom request method CLONE rejected?

Added by bwechner over 3 years ago

I'm not 100% sure what's going on here. A feature of the PicoCMS (copying things) fails and efforts to trace why have met with mixed success. The hottest clue I have though is that probably lighttpd is not forwarding the request on via FastCGI, but rejecting it. Here are the clues:

$ curl -i 'https://myserver.tld/index.php/apps/cms_pico/admin/themes/default' -X CLONE
HTTP/1.0 501 Not Implemented
Content-Type: text/html
Content-Length: 353
Connection: close
Date: Sun, 06 Sep 2020 01:57:45 GMT
Server: lighttpd/1.4.55

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
 <head>
  <title>501 Not Implemented</title>
 </head>
 <body>
  <h1>501 Not Implemented</h1>
 </body>
</html>

And the lighttpd access log then has recorded in it the cryptically terse:

access.log:192.168.0.11 - - [06/Sep/2020:11:54:26 +1000] "  " 501 353 "-" "-" 

while the error log shows no clues.

Could it be that lighttpd is producing this 501 error?

This is a new kind of request on me. It's used by the NextCloud WebDAV interface and I see only sporadic documentation on it. Curl itself for example writes:

-X (HTTP) Specifies a custom request method to use when communicating with the HTTP server.  The specified request method will be used instead of the method otherwise used (which defaults to GET). Read the HTTP 1.1 speci‐
              fication for details and explanations. Common additional HTTP requests include PUT and DELETE, but related technologies like WebDAV offers PROPFIND, COPY, MOVE and more.

The actual request is a tad richer, producing the same response, I have distilled it down to this `-X CLONE` argument. I get the curl command from Chromium's debugger on the network tab where I can see the request that browser makes that is failing with a 501 response. It happens with trying copy a theme in this instance. Looks to me like the WebDAV interface they have written supports a custom request type of CLONE, but that this request isn't reaching the WEB DAV server, it's being bounced earlier. Candidates have of course bewteen lighttpd, PHP or Nextcloud itself. But the clues suggest it's lighttpd. Possible?

And if so, how further to confirm that and/or work around it? If not, how to interpret the odd access log entry?