incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Bykov <m.by...@gmail.com>
Subject unauthorized ajax PUT to other base
Date Thu, 08 Dec 2011 11:55:17 GMT
Hi,

I am trying to ping parallel /counters base.

default.ini:

secure_rewrites = false

rewrites:
  {
    "from":"/counter",
    "to":"../../../counters",
    "method":"PUT",
    "query":{}
  },

ajax call:

    pingCounter: function(obj){
      console.log('ping: ');
      $.ajax({
        type: "PUT",
        url: '/counter',
        data: { page : obj },
        dataType: 'json',
        success: function(msg) {
          console.log( "ping saved: " + msg );
        }
      });
    }

And in log I got

'PUT' /counters 401 <=== note correct 'counters' DB name, so rewrites works ok.

But this error occurred: {"error":"unauthorized","reason":"You are not
a server admin."}

Where I should place my admin password for DB "counters" ? In rewrites
rule? But how?


-- 
лю.

http://diglossa.ru
xmpp://m.bykov@jabber.ru

Mime
View raw message