Skip to content

Commit

Permalink
test: send content-type with proxy POST tests
Browse files Browse the repository at this point in the history
Backports PR #10903

**Commit 1:**
test: send content-type with proxy POST tests

Elasticsearch now requires that content-type be sent on all requests
with payloads, so our tests should be sending it with requests as well.

* Original sha: d5832cf
* Authored by Court Ewing <[email protected]> on 2017-03-27T16:31:59Z
  • Loading branch information
elastic-jasper committed Mar 27, 2017
1 parent 5c57720 commit 96fc0c9
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/core_plugins/elasticsearch/lib/__tests__/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,18 +93,27 @@ describe('plugins/elasticsearch', function () {
testRoute({
method: 'POST',
url: '/elasticsearch/.kibana/__kibanaQueryValidator/_validate/query?explain=true&ignore_unavailable=true',
headers: {
'content-type': 'application/json'
},
payload: { query: { query_string: { analyze_wildcard: true, query: '*' } } }
});

testRoute({
method: 'POST',
url: '/elasticsearch/_mget',
headers: {
'content-type': 'application/json'
},
payload: { docs: [{ _index: '.kibana', _type: 'index-pattern', _id: '[logstash-]YYYY.MM.DD' }] }
});

testRoute({
method: 'POST',
url: '/elasticsearch/_msearch',
headers: {
'content-type': 'application/json'
},
payload: '{"index":"logstash-2015.04.21","ignore_unavailable":true}\n{"size":500,"sort":{"@timestamp":"desc"},"query":{"bool":{"must":[{"query_string":{"analyze_wildcard":true,"query":"*"}},{"bool":{"must":[{"range":{"@timestamp":{"gte":1429577068175,"lte":1429577968175}}}],"must_not":[]}}],"must_not":[]}},"highlight":{"pre_tags":["@kibana-highlighted-field@"],"post_tags":["@/kibana-highlighted-field@"],"fields":{"*":{}}},"aggs":{"2":{"date_histogram":{"field":"@timestamp","interval":"30s","min_doc_count":0,"extended_bounds":{"min":1429577068175,"max":1429577968175}}}},"stored_fields":["*"],"_source": true,"script_fields":{},"docvalue_fields":["timestamp_offset","@timestamp","utc_time"]}\n' // eslint-disable-line max-len
});

Expand Down

0 comments on commit 96fc0c9

Please sign in to comment.