Skip to content

Commit

Permalink
reset feature switch
Browse files Browse the repository at this point in the history
Signed-off-by: Su <szhongna@amazon.com>
  • Loading branch information
zhongnansu committed Mar 15, 2023
1 parent b4db124 commit efb2e88
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion config/opensearch_dashboards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@

# Set the value of this setting to true to enable the experimental multiple data source
# support feature. Use with caution.
data_source.enabled: true
#data_source.enabled: false
# Set the value of these settings to customize crypto materials to encryption saved credentials
# in data sources.
#data_source.encryption.wrappingKeyName: 'changeme'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,12 @@ function getProxyHeaders(req: OpenSearchDashboardsRequest) {
}

function toUrlPath(path: string) {
const urlPath = `/${trimStart(path, '/')}`;
let urlPath = `/${trimStart(path, '/')}`;
// Appending pretty here to have OpenSearch do the JSON formatting, as doing
// in JS can lead to data loss (7.0 will get munged into 7, thus losing indication of
// measurement precision)
if (!urlPath.includes('?pretty')) {
urlPath.concat('?pretty=true');
urlPath += '?pretty=true';
}
return urlPath;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,21 +64,21 @@ describe('Console Proxy Route', () => {
it('treats the url as a path', async () => {
await request('GET', 'http://evil.com/test');
const [[args]] = opensearchClient.asCurrentUser.transport.request.mock.calls;
expect(args.path).toBe('http://evil.com/test?pretty=true');
expect(args.path).toBe('/http://evil.com/test?pretty=true');
});
});
describe('starts with a slash', () => {
it('combines well with the base url', async () => {
it('keeps as it is', async () => {
await request('GET', '/index/id');
const [[args]] = opensearchClient.asCurrentUser.transport.request.mock.calls;
expect(args.path).toBe('/index/id?pretty=true');
});
});
describe(`doesn't start with a slash`, () => {
it('combines well with the base url', async () => {
it('adds slash to path before sending request', async () => {
await request('GET', 'index/id');
const [[args]] = opensearchClient.asCurrentUser.transport.request.mock.calls;
expect(args.path).toBe('index/id?pretty=true');
expect(args.path).toBe('/index/id?pretty=true');
});
});
});
Expand Down

0 comments on commit efb2e88

Please sign in to comment.