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

Sam Bisbee commented on COUCHDB-1005:
-------------------------------------

While I'm all for a more feature rich rewrite/regex engine after benchmarking, 
I don't think it's needed to fulfill the needs of this ticket. The current 
implementation already allows for URLs to be built using multiple variables, as 
long as they are separated by a slash. All that needs to happen is to have that 
restriction lifted - allow >=0 characters as separators. Even allowing >=1 
character would be a huge improvement, because it would allow document ids to 
be built, while we currently can only build URLs.

Of course, I don't know the internals well enough, but an educated 
guess/feeling says that this shouldn't be too tricky. Or am I missing a piece 
of complexity?

Cheers.

> Rewriting to a URL with 2 replacements fails
> --------------------------------------------
>
>                 Key: COUCHDB-1005
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-1005
>             Project: CouchDB
>          Issue Type: Bug
>    Affects Versions: 1.0.1
>            Reporter: Sam Bisbee
>
> When I pull two variables out of a URL and drop them into the target, the 
> target URL breaks. However, it appears that the variables are being captured 
> appropriately.
> This couch was built from source on Ubuntu 10.04 and is running a default 
> config.
> Unexpected Results
> ----------------------------
> Assuming that we're querying the _rewrite handler with /foo/bar
> { "from": "/:user/:plugin", "to": "../../:user-:plugin"} will result in 
> /db/undefined?user=foo&plugin=bar
> { "from": "/:user/:plugin", "to": "../../:user :plugin"} will result in 
> /db/undefined?user=foo&plugin=bar
> { "from": "/:user/:plugin", "to": "../../:user"} will CORRECTLY result in 
> /db/foo?user=foo&plugin=bar
> Expected Results
> ------------------------
> { "from": "/:user/:plugin", "to": "../../:user-:plugin"} should result in 
> /db/foo-bar?user=foo&plugin=bar
> { "from": "/:user/:plugin", "to": "../../:user :plugin"} will result in 
> /db/foo bar?user=foo&plugin=bar

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

Reply via email to