Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 18 additions & 49 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion test-packages/e2e-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"axios": "1.19.0",
"bignumber.js": "11.1.5",
"express": "5.2.1",
"http-proxy-middleware": "3.0.7",
"http-proxy-middleware": "4.2.0",
"json-schema-faker": "0.6.3",
"moment": "2.30.1",
"multer": "2.2.0",
Expand Down
13 changes: 10 additions & 3 deletions test-packages/e2e-tests/test/proxy/proxy-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,21 @@ app.use((req, res, next) => {
res.sendStatus(403);
}
});
// [define proxy behaviour] use the "url" value from the original request
// [define proxy behaviour] use the path from the original request URL
app.use(
'/',
createProxyMiddleware({
target: odataBaseUrl,
changeOrigin: true,
pathRewrite: (path, req) => {
return req.url;
pathRewrite: (path) => {
// http-proxy-middleware v4 (httpxy) passes the full absolute URL as path for proxy requests;
// extract just the path+query portion so the target doesn't receive a double URL.
try {
const { pathname, search } = new URL(path);
return pathname + search;
} catch {
return path;
}
}
})
);
Expand Down