I wish the following rewrite rule worked:
{
"from": "api/*",
"to": "../../../*"
}
… in a vhost rewrite like the following:
[vhosts]
myapp = /myapp/_design/myapp/_rewrite
Then it would be possible to access the root API in a following manner:
$.couch.urlPrefix = '/api';
var dbs = $.couch.allDbs({
success: function (data) {
console.log(data);
}
})
But unfortunately the request to http://myapp:5984/api/_all_dbs results into:
{"error":"insecure_rewrite_rule","reason":"too many ../.. segments"}
Am I missing something? Is something wrong with the rewrite? Does anyone know how to overcome that? My Couchdb is 1.1.1.
I'm acquainted to this advice, but don't like any of the suggested ways.
Add
[httpd]
secure_rewrites=false
to your server's local.ini to disable this protection from cross-database rewrites.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With