Skip to content

Commit

Permalink
fix(@angular-devkit/build-angular): avoid dev-server proxy rewrite no…
Browse files Browse the repository at this point in the history
…rmalization 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
  • Loading branch information
clydin authored and alan-agius4 committed Oct 9, 2023
1 parent 8981d8c commit 2c33f09
Showing 1 changed file with 1 addition and 0 deletions.
Expand Up @@ -138,6 +138,7 @@ function normalizeProxyConfiguration(
// Replace `pathRewrite` field with a `rewrite` function
for (const proxyEntry of Object.values(normalizedProxy)) {
if (
typeof proxyEntry === 'object' &&
'pathRewrite' in proxyEntry &&
proxyEntry.pathRewrite &&
typeof proxyEntry.pathRewrite === 'object'
Expand Down

0 comments on commit 2c33f09

Please sign in to comment.