Skip to content

Commit 2198a8e

Browse files
committed
fix: update router to pathRewrite in proxy option tests
1 parent 87863f2 commit 2198a8e

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

test/server/proxy-option.test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ const proxyOptionPathsAsProperties = [
2424
},
2525
{
2626
context: "/foo",
27-
router: (req) => {
27+
pathRewrite: (_path, req) => {
2828
if (/\.html$/.test(req.path || req.url)) {
2929
return "/index.html";
3030
}
3131

32-
return null;
32+
return req.path;
3333
},
3434
},
3535
{
@@ -50,7 +50,7 @@ const proxyOptionPathsAsProperties = [
5050
target: `http://localhost:${port1}`,
5151
changeOrigin: true,
5252
secure: false,
53-
router: (req) => {
53+
pathRewrite: (_path, req) => {
5454
if (/\.(html)$/i.test(req.path || req.url)) {
5555
return req.url;
5656
}

0 commit comments

Comments
 (0)