summaryrefslogtreecommitdiff
path: root/core/src/test/java/org/elasticsearch/search/rescore/QueryRescoreBuilderTests.java
diff options
context:
space:
mode:
authorJason Tedor <jason@tedor.me>2016-10-04 12:45:29 -0400
committerGitHub <noreply@github.com>2016-10-04 12:45:29 -0400
commit51d53791fe71c9cb62bc992588a57cdfb500383f (patch)
treeea8496794e036d34403256da2394c16acc9df435 /core/src/test/java/org/elasticsearch/search/rescore/QueryRescoreBuilderTests.java
parent2b3760f78b26817b5a2030aa27b1ddf2f17462f6 (diff)
Remove lenient URL parameter parsing
Today when parsing a request, Elasticsearch silently ignores incorrect (including parameters with typos) or unused parameters. This is bad as it leads to requests having unintended behavior (e.g., if a user hits the _analyze API and misspell the "tokenizer" then Elasticsearch will just use the standard analyzer, completely against intentions). This commit removes lenient URL parameter parsing. The strategy is simple: when a request is handled and a parameter is touched, we mark it as such. Before the request is actually executed, we check to ensure that all parameters have been consumed. If there are remaining parameters yet to be consumed, we fail the request with a list of the unconsumed parameters. An exception has to be made for parameters that format the response (as opposed to controlling the request); for this case, handlers are able to provide a list of parameters that should be excluded from tripping the unconsumed parameters check because those parameters will be used in formatting the response. Additionally, some inconsistencies between the parameters in the code and in the docs are corrected. Relates #20722
Diffstat (limited to 'core/src/test/java/org/elasticsearch/search/rescore/QueryRescoreBuilderTests.java')
0 files changed, 0 insertions, 0 deletions