couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christopher Bonhage (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (COUCHDB-1229) _update handler doesn't support slashes in doc _id
Date Wed, 20 Jul 2011 22:45:58 GMT

    [ https://issues.apache.org/jira/browse/COUCHDB-1229?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13068686#comment-13068686
] 

Christopher Bonhage commented on COUCHDB-1229:
----------------------------------------------

I encountered this as well; digging through src/couch_httpd_show.erl, handle_doc_show_req/3
appears to handle the "/" character in Document IDs properly:

DocParts = [DocId|Rest],
DocId1 = ?l2b(string:join([?b2l(P)|| P <- DocParts], "/")),

It seems like a bug that the _show handler joins the path parts back together, but the _update
handler does not.

Obviously / is an important character in URL paths, but I don't see how that affects the trailing
path parts here: database/_design/ddoc/_update/handler/docidpart1/docidpart2

Am I wrong?

> _update handler doesn't support slashes in doc _id
> --------------------------------------------------
>
>                 Key: COUCHDB-1229
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-1229
>             Project: CouchDB
>          Issue Type: Bug
>          Components: HTTP Interface
>    Affects Versions: 1.1
>            Reporter: Simon Leblanc
>              Labels: URI, id, update
>
> Let's say you have:
> - a doc with _id foo/bar
> - a show function named baz
> - a update function named baz
> Then _show/baz/foo/bar is valid but _update/baz/foo/bar is not. Only _update/baz/foo%2Fbar
works.
> This is particularly annoying when you want to rewrite /something/* to _update/baz/foo/*
(rewriting /something/* to _show/baz/foo/* works perfectly).

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message