avoid redirects in ajax requests

Change-Id: I031eea7fd9cc0cec4292c6f8dfec2df9691fc884
Reviewed-on: http://review.couchbase.org/23678
Tested-by: buildbot <build@couchbase.com>
Reviewed-by: Pavel Paulau <pavel.paulau@gmail.com>