I am trying to do a PUT to the _config endpoint using the admin port of the Sync Gateway (v1.3.1)/
Here is the PUT body:
{
"server": "http://clusternode:8091/",
"pool": "default",
"bucket": "default",
"name": "default",
"sync": "function(doc, oldDoc){throw({forbidden:'Hello World'}); }",
"users": {
"GUEST": {
"name": "",
"all_channels": null
}
}
}
The server returns a response of 201 Created. When I submit a GET to the _config endpoint, the updated configuration is returned as expected. However, this configuration does not seem to be used at all by the Sync Gateway.
If I then try to save a document to the Sync Gateway, I expect to receive a “forbidden” response. Instead, the previous (original) Sync Function is used and the exception is not thrown at all. It seems to always be using the settings from the “sync_gateway.json” file from /home/sync_gateway.
I have tried restarting the Sync Gateway service after the issuing the PUT, but this has had no affect.
Any ideas?