DESCRIPTION

JCBC-571: Switch to POST if view query is too long

Motivation
----------
Server-side limitation prevents GET requests that grow too large to be
executed. If the query string is too large, most probable culprit is the
keys parameter, and it is the only one that can be passed in as the body
of a POST request.

Modifications
-------------
A method to extract the keys part of a query string if it gets over a
specified threshold has been introduced.

If this method actually splits, then the HTTP request becomes a POST and
its body is the keys is JSON form, while the rest of the uri parameters
are kept in the query string.

Tests have been added to validate both utility method and the behavior
of the handler when a large query is issued.

Split threshold for query requests have been semi-arbitrarily fixed to
1024 characters (even if the query server should be able to handle URIs
in the 4KB range).

Results
-------
Large view queries switch to POST and have the "keys" parameter in the
body, allowing them to go through.

Change-Id: I38048d881103ee285ca526f143131d478c0feb12
Reviewed-on: http://review.couchbase.org/41725
Tested-by: Estrella Humphrey xxx@xxx.xxx
Reviewed-by: Natasha Sullivan xxx@xxx.xxx


COMMENTS

author: Gerrit Code Review
date: 2015-02-26 08:34:32.200000000

Change has been successfully cherry-picked as 36d20dcc3ade1903718d259f88d3d81cf042a749

-------------------------------------
