Skip to content

Commit

Permalink
Removed trailing / in paths in tests (#923)
Browse files Browse the repository at this point in the history
* Removed trailing `/` in paths in tests

Signed-off-by: Theo Truong <[email protected]>
  • Loading branch information
nhtruong authored Nov 18, 2024
1 parent 55fd7d1 commit 3a44a33
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion api/cluster/health.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function healthFunc(params, options, callback) {
let { body, index, ...querystring } = params;
index = parsePathParam(index);

const path = ['/_cluster/health/', index].filter(c => c).join('').replace('//', '/');
const path = ['/_cluster/health', index].filter(c => c).join('/');
const method = 'GET';
body = body || '';

Expand Down
12 changes: 6 additions & 6 deletions test/acceptance/proxy.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ test('http-http proxy support', async (t) => {
const server = await createServer();
const proxy = await createProxy();
server.on('request', (req, res) => {
t.equal(req.url, '/_cluster/health/');
t.equal(req.url, '/_cluster/health');
res.setHeader('content-type', 'application/json');
res.end(JSON.stringify({ hello: 'world' }));
});
Expand All @@ -44,7 +44,7 @@ test('http-https proxy support', async (t) => {
const server = await createSecureServer();
const proxy = await createProxy();
server.on('request', (req, res) => {
t.equal(req.url, '/_cluster/health/');
t.equal(req.url, '/_cluster/health');
res.setHeader('content-type', 'application/json');
res.end(JSON.stringify({ hello: 'world' }));
});
Expand All @@ -65,7 +65,7 @@ test('https-http proxy support', async (t) => {
const server = await createServer();
const proxy = await createSecureProxy();
server.on('request', (req, res) => {
t.equal(req.url, '/_cluster/health/');
t.equal(req.url, '/_cluster/health');
res.setHeader('content-type', 'application/json');
res.end(JSON.stringify({ hello: 'world' }));
});
Expand All @@ -86,7 +86,7 @@ test('https-https proxy support', async (t) => {
const server = await createSecureServer();
const proxy = await createSecureProxy();
server.on('request', (req, res) => {
t.equal(req.url, '/_cluster/health/');
t.equal(req.url, '/_cluster/health');
res.setHeader('content-type', 'application/json');
res.end(JSON.stringify({ hello: 'world' }));
});
Expand All @@ -107,7 +107,7 @@ test('http basic authentication', async (t) => {
const server = await createServer();
const proxy = await createProxy();
server.on('request', (req, res) => {
t.equal(req.url, '/_cluster/health/');
t.equal(req.url, '/_cluster/health');
res.setHeader('content-type', 'application/json');
res.end(JSON.stringify({ hello: 'world' }));
});
Expand Down Expand Up @@ -136,7 +136,7 @@ test('https basic authentication', async (t) => {
const server = await createSecureServer();
const proxy = await createProxy();
server.on('request', (req, res) => {
t.equal(req.url, '/_cluster/health/');
t.equal(req.url, '/_cluster/health');
res.setHeader('content-type', 'application/json');
res.end(JSON.stringify({ hello: 'world' }));
});
Expand Down

0 comments on commit 3a44a33

Please sign in to comment.