Skip to content

Commit b3294d3

Browse files
committed
fixed proxy config test
1 parent 2d9b449 commit b3294d3

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

test/proxy-config.test.js

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,11 @@ const httpsOpts = {
1818
}
1919

2020
const proxyConfigTest = {
21-
"/rewrite/*": {
21+
"/rewrite/**": {
2222
"target": "http://localhost:8082",
2323
"pathRewrite": {
2424
"^/rewrite": ""
2525
}
26-
},
27-
"*": {
28-
"target": "http://localhost:8082",
29-
"changeOrigin": true,
30-
"secure": false
3126
}
3227
}
3328

@@ -55,6 +50,7 @@ test('proxy config', (t) => {
5550

5651
// Another server proxies 8083 to 8082
5752
const proxyServer = httpServer.createServer({
53+
root,
5854
//tls: true,
5955
//https: httpsOpts,
6056
proxyConfig: proxyConfigTest
@@ -70,7 +66,7 @@ test('proxy config', (t) => {
7066

7167
// File content matches
7268
const fileData = await fsReadFile(path.join(root, 'file'), 'utf8')
73-
t.equal(res.body.trim(), fileData.trim(), 'proxied file content matches')
69+
t.equal(res.body.trim(), fileData.trim(), 'none proxied file content matches')
7470
}).catch(err => t.fail(err.toString()))
7571

7672
// Serve files from proxy with rewrite

0 commit comments

Comments
 (0)