incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From 7zark7 <7za...@gmail.com>
Subject Re: URL transformation within CouchDB?
Date Thu, 08 Apr 2010 04:38:07 GMT
On 4/7/10 9:15 PM, Randall Leeds wrote:
> On Wed, Apr 7, 2010 at 20:53, 7zark7<7zark7@gmail.com>  wrote:
>> Hi, is there *any* way within CouchDB to modify a GET URL to replace certain
>> characters in the document id?
>
> Probably easiest if you can have the client encode the URL for you. I
> don't know if that's acceptable for your use case.

Yeah not in my case.  This is basically a CMS for static content, and 
the end users aren't under my immediate control.


 >> More specifically what I'd like to do is take a request URL that
 >> contains forward slashes, such as:
 >>
 >> a/b/c/d.jpg
 >>
 >> and transform this to return a document which has the id:
 >>
 >> a%2Fb%2Fc%2Fd.jpg
 >>
 >> etc.
 >>
 >> I've tried the rewrite functionality, but doesn't look like it
 >> supports modifying characters.  I've also tried hacky approaches
 >> like this:
 >>
 >> {
 >>   "from": "/file/:a/:b/:c/:d",
 >>   "to": "../../:a%2:b%2:c%2:d"
 >> }
 >>
 >> but the URL doesn't replace this correctly (shows "undefined" in the
 >>  URL)
 >>
 >> show functions can't seem to handle rendering attachments as far as
 >> I can tell.
 >>
 >> Any ideas?  I know about reverse proxys, etc, just would like to
 >> avoid additional layers here.
 >>
 >>
 >> Thanks

Mime
View raw message