diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index aeca591edd..137a114137 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -875,8 +875,8 @@ importers: specifier: 5.2.1 version: 5.2.1 http-proxy-middleware: - specifier: 3.0.7 - version: 3.0.7 + specifier: 4.2.0 + version: 4.2.0 json-schema-faker: specifier: 0.6.3 version: 0.6.3 @@ -2530,9 +2530,6 @@ packages: '@types/hast@3.0.5': resolution: {integrity: sha512-rp/ezSWaD1m44dPKICGhiskI13nVr7qTloFwDa/IYkhhf5nzwP+zIQcIJh3WIFSBOy/H1PzB40jPjMDksN4F+g==} - '@types/http-proxy@1.17.17': - resolution: {integrity: sha512-ED6LB+Z1AVylNTu7hdzuBqOgMnvG/ld6wGCG8wFnAzKX5uyW2K3WD52v0gnLCTK/VLpXtKckgWuyScYK6cSPaw==} - '@types/istanbul-lib-coverage@2.0.6': resolution: {integrity: sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w==} @@ -3733,9 +3730,6 @@ packages: eventemitter2@6.4.9: resolution: {integrity: sha512-JEPTiaOt9f04oa6NOkc4aH+nVp5I3wEjpHbIPqfgCdD5v5bUzy7xQqwcVO2aDQgOWhI28da57HksMrzK9HlRxg==} - eventemitter3@4.0.7: - resolution: {integrity: sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==} - execa@5.1.1: resolution: {integrity: sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==} engines: {node: '>=10'} @@ -4045,13 +4039,9 @@ packages: resolution: {integrity: sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==} engines: {node: '>= 14'} - http-proxy-middleware@3.0.7: - resolution: {integrity: sha512-iwbQltVlx8bCrqePUM8C+hllHvdawVhQJaLrj1X7qllkvFQdXFsr16pW/mo9+JDVjN+QO2XUx9jd8SmoFkE5qw==} - engines: {node: ^14.18.0 || ^16.10.0 || >=18.0.0} - - http-proxy@1.18.1: - resolution: {integrity: sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ==} - engines: {node: '>=8.0.0'} + http-proxy-middleware@4.2.0: + resolution: {integrity: sha512-ZA+oNOoM+GLoFTIzhkJptVQov73Srep2LBqhF8hG8CIPKO3nam1jonXVQ/QUH8RbwsmaaVz2SOJdzBNBHNtKbw==} + engines: {node: ^22.15.0 || ^24.0.0 || >=26.0.0} http2-client@1.3.5: resolution: {integrity: sha512-EC2utToWl4RKfs5zd36Mxq7nzHHBuomZboI0yYL6Y0RmBgT7Sgkq4rQ0ezFTYoIsSs7Tm9SJe+o2FcAg6GBhGA==} @@ -4064,6 +4054,9 @@ packages: resolution: {integrity: sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==} engines: {node: '>= 14'} + httpxy@0.5.5: + resolution: {integrity: sha512-uDjmnPyp1q4Sgzf3w+J/Fc6UqcCEj0x4Wjp7OqK5dGhNeDgpyrAmnS6ey8QWrX3SWDon2DMKf9sBa5X9+CVyMA==} + human-id@4.2.1: resolution: {integrity: sha512-zPGsiS+dWoTZtZ4AtpA9Y+BdSFSNWvnouNlWNoUFyAM6xHOHmdCvqO3k8AIbdamCOv4gUFUVNPf6rJFfc4UiJw==} hasBin: true @@ -4182,9 +4175,9 @@ packages: resolution: {integrity: sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg==} engines: {node: '>=0.10.0'} - is-plain-object@5.0.0: - resolution: {integrity: sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==} - engines: {node: '>=0.10.0'} + is-plain-obj@4.1.0: + resolution: {integrity: sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg==} + engines: {node: '>=12'} is-promise@4.0.0: resolution: {integrity: sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==} @@ -5132,9 +5125,6 @@ packages: engines: {node: '>=0.4.0'} hasBin: true - requires-port@1.0.0: - resolution: {integrity: sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==} - reserved-identifiers@1.2.0: resolution: {integrity: sha512-yE7KUfFvaBFzGPs5H3Ops1RevfUEsDc5Iz65rOwWg4lE8HJSYtle77uul3+573457oHvBKuHYDl/xqUkKpEEdw==} engines: {node: '>=18'} @@ -7222,10 +7212,6 @@ snapshots: dependencies: '@types/unist': 3.0.3 - '@types/http-proxy@1.17.17': - dependencies: - '@types/node': 22.20.1 - '@types/istanbul-lib-coverage@2.0.6': {} '@types/istanbul-lib-report@3.0.3': @@ -7736,7 +7722,7 @@ snapshots: axios@1.19.0: dependencies: - follow-redirects: 1.16.0 + follow-redirects: 1.16.0(debug@4.3.7) form-data: 4.0.6 https-proxy-agent: 5.0.1 proxy-from-env: 2.1.0 @@ -8437,8 +8423,6 @@ snapshots: eventemitter2@6.4.9: {} - eventemitter3@4.0.7: {} - execa@5.1.1: dependencies: cross-spawn: 7.0.6 @@ -8625,16 +8609,10 @@ snapshots: fn.name@1.1.0: {} - follow-redirects@1.16.0: {} - follow-redirects@1.16.0(debug@4.3.7): optionalDependencies: debug: 4.3.7 - follow-redirects@1.16.0(debug@4.4.3): - optionalDependencies: - debug: 4.4.3 - foreground-child@3.3.1: dependencies: cross-spawn: 7.0.6 @@ -8819,25 +8797,16 @@ snapshots: transitivePeerDependencies: - supports-color - http-proxy-middleware@3.0.7: + http-proxy-middleware@4.2.0: dependencies: - '@types/http-proxy': 1.17.17 debug: 4.4.3 - http-proxy: 1.18.1(debug@4.4.3) + httpxy: 0.5.5 is-glob: 4.0.3 - is-plain-object: 5.0.0 + is-plain-obj: 4.1.0 micromatch: 4.0.8 transitivePeerDependencies: - supports-color - http-proxy@1.18.1(debug@4.4.3): - dependencies: - eventemitter3: 4.0.7 - follow-redirects: 1.16.0(debug@4.4.3) - requires-port: 1.0.0 - transitivePeerDependencies: - - debug - http2-client@1.3.5: {} https-proxy-agent@5.0.1: @@ -8854,6 +8823,8 @@ snapshots: transitivePeerDependencies: - supports-color + httpxy@0.5.5: {} + human-id@4.2.1: {} human-signals@2.1.0: {} @@ -8935,7 +8906,7 @@ snapshots: is-plain-obj@1.1.0: {} - is-plain-object@5.0.0: {} + is-plain-obj@4.1.0: {} is-promise@4.0.0: {} @@ -10196,8 +10167,6 @@ snapshots: requirejs@2.3.8: {} - requires-port@1.0.0: {} - reserved-identifiers@1.2.0: {} resolve-cwd@3.0.0: diff --git a/test-packages/e2e-tests/package.json b/test-packages/e2e-tests/package.json index 02c6099a70..24b06c3a66 100644 --- a/test-packages/e2e-tests/package.json +++ b/test-packages/e2e-tests/package.json @@ -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", diff --git a/test-packages/e2e-tests/test/proxy/proxy-server.js b/test-packages/e2e-tests/test/proxy/proxy-server.js index a12c040f36..c4261b65af 100644 --- a/test-packages/e2e-tests/test/proxy/proxy-server.js +++ b/test-packages/e2e-tests/test/proxy/proxy-server.js @@ -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; + } } }) );