Skip to content

Commit 8260150

Browse files
perf: optimize parseCspHeaders (#29887)
* fix: optimize parseCspHeaders * Added changelog notes * Fix changelog --------- Co-authored-by: Jennifer Shehane <[email protected]>
1 parent 6b761d5 commit 8260150

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

cli/CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33

44
_Released 7/30/2024 (PENDING)_
55

6+
**Performance:**
7+
8+
- Improved performance of `reduce` in a method within our proxy. Addressed in [#29887](https://github.com/cypress-io/cypress/pull/29887).
9+
610
**Bugfixes:**
711

812
- Fixed an issue where yarn PnP was not working correctly with Cypress and `@cypress/webpack-batteries-included-preprocessor`. Fixes [#27947](https://github.com/cypress-io/cypress/issues/27947).

packages/proxy/lib/http/util/csp-header.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,9 @@ export function parseCspHeaders (headers: OutgoingHttpHeaders, headerName: strin
107107
policy = cspRegExp.exec(cspHeader)
108108
}
109109

110-
return [...acc, policies]
110+
acc.push(policies)
111+
112+
return acc
111113
}, [])
112114
}
113115

0 commit comments

Comments
 (0)