couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jason Smith (JIRA)" <>
Subject [jira] Commented: (COUCHDB-815) Non-standard HTTP methods for view handlers (AKA WebDAV is b0rken) [PATCH]
Date Mon, 05 Jul 2010 06:33:53 GMT


Jason Smith commented on COUCHDB-815:

A workaround if you have admin access is to make an Erlang design document with a show function
to define those atoms:

      "_id": "_design/enable_dav",
      "usage": "curl localhost:5984/dav/_design/enable_dav/_show/add_atoms",
      "language": "erlang",
      "shows": {
        "add_atoms": "fun(Doc, {Req}) ->
                        'PROPFIND', 'PROPPATCH', 'MKCOL', 'COPY', 'MOVE', 'LOCK', 'UNLOCK',
                        {[{<<\"body\">>, <<\"WebDAV enabled\\n\">>}]}

And then you hit the view once per VM execution.

> Non-standard HTTP methods for view handlers (AKA WebDAV is b0rken) [PATCH]
> --------------------------------------------------------------------------
>                 Key: COUCHDB-815
>                 URL:
>             Project: CouchDB
>          Issue Type: Bug
>          Components: Database Core
>    Affects Versions: 1.0
>            Reporter: Jason Smith
>            Priority: Minor
>         Attachments: bad_allow_any_http_method.patch
> CouchDB prevents the new view server handler methods, _show, _update, etc. from handling
unknown HTTP methods. This prevents Couch apps from being able to implement extensions to
the HTTP specification or to add application-specific methods to HTTP, violating the spirit
of _show and _update.
> For example, it is not possible to make a CouchApp WebDAV server because _show and _list
must support the PROPFIND method.
> In couch_httpd:handle_request_int/5, the response from Mochi is coerced to an atom if
and only if the atom already exists (using couch_util:to_existing_atom/1). That is an odd
whitelist, to say the least:
>     $ curl localhost:5984 -X PROPFIND # Crashes mochiweb when to_existing_atom throws
>     curl: (52) Empty reply from server
>     $ curl localhost:5984 -X list_to_binary # Any atom works
>     {"error":"method_not_allowed","reason":"Only GET,HEAD allowed"}
> Considering the cURL commands above, I filed this as a bug, not a feature. I will explore
some options and submit patches.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message