Skip to content

Commit 2c33f09

Browse files
clydinalan-agius4
authored andcommitted
fix(@angular-devkit/build-angular): avoid dev-server proxy rewrite normalization when invalid value
When normalizing the proxy configuration for the Vite-based development server, the `pathRewrite` logic will now be skipped if the proxy entry is not an object and therefore invalid. This situation can occur if the proxy configuration JSON contains invalid properties. Closes #25978
1 parent 8981d8c commit 2c33f09

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

packages/angular_devkit/build_angular/src/builders/dev-server/load-proxy-config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ function normalizeProxyConfiguration(
138138
// Replace `pathRewrite` field with a `rewrite` function
139139
for (const proxyEntry of Object.values(normalizedProxy)) {
140140
if (
141+
typeof proxyEntry === 'object' &&
141142
'pathRewrite' in proxyEntry &&
142143
proxyEntry.pathRewrite &&
143144
typeof proxyEntry.pathRewrite === 'object'

0 commit comments

Comments
 (0)