Skip to content
This repository was archived by the owner on Dec 14, 2022. It is now read-only.

Commit c07e016

Browse files
author
Chris Wiechmann
committed
VHost is not given in all cases
#103
1 parent e5ee965 commit c07e016

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

apibuilder4elastic/test/trafficMonitorAPI/asAdmin/http/test_search_endpoint_AsAdmin.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ describe('Endpoints', function () {
7070
expect(body.data[0].timestamp).gt(body.data[1].timestamp);
7171
expect(body.data[1].timestamp).gt(body.data[2].timestamp);
7272
expect(body.data[2].timestamp).gt(body.data[3].timestamp);
73-
checkFields(body.data, false);
73+
checkFields(body.data, false, false);
7474
});
7575
});
7676

@@ -622,7 +622,8 @@ describe('Endpoints', function () {
622622
});
623623
});
624624

625-
function checkFields(data, hasServiceContext) {
625+
function checkFields(data, hasServiceContext, hasVhost) {
626+
if(hasVhost == undefined) hasVhost = true;
626627
data.map((entry) => {
627628
expect(entry).to.have.property('timestamp');
628629
expect(entry).to.have.property('statustext');
@@ -639,7 +640,9 @@ function checkFields(data, hasServiceContext) {
639640
expect(entry).to.have.property('remoteAddr');
640641
expect(entry).to.have.property('remotePort');
641642
expect(entry).to.have.property('localAddr');
642-
expect(entry).to.have.property('vhost');
643+
if(hasVhost) {
644+
expect(entry).to.have.property('vhost');
645+
}
643646
expect(entry).to.have.property('leg');
644647
if(entry.method!='OPTIONS') {
645648
expect(entry).to.have.property('finalStatus');

0 commit comments

Comments
 (0)