You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2021/05/16 19:33:57 UTC

[GitHub] [couchdb] nickva commented on issue #3565: CouchDB unescaping URL paths incorrectly

nickva commented on issue #3565:
URL: https://github.com/apache/couchdb/issues/3565#issuecomment-841866009


   I think it's coming from mochiweb were it calls [unquote]( https://github.com/mochi/mochiweb/blob/070594e4d66163d662ac7e3bfb75dadcc922dd7c/src/mochiweb_request.erl#L214) on the path but it actually uses the [unquote_plus](https://github.com/mochi/mochiweb/blob/070594e4d66163d662ac7e3bfb75dadcc922dd7c/src/mochiweb_util.erl#L256-L257) decoding logic where a `+` would be turned into a space. 
   
   Recently we encountered a somewhat similar issue with userinfo decoding/decoding in replicator in https://github.com/apache/couchdb/pull/3546. Where, according to the RFC, it turns out `+` is a valid userinfo character as well but we would decode it into a space now if we just the use the decode logic in mochiweb.
   
   Agree, not sure what a good way to fix this is in a backwards compatible way. Could be it's a 4.0 feature or we just document that `+` will always be decoded to a space and if you want a `+` in doc id it would have to be url encoded.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org