Skip to content

fix(@angular/build): avoid internal karma request cache for assets #30227

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

clydin
Copy link
Member

@clydin clydin commented May 1, 2025

The internal karma common middleware that handles requests converts the to be cached data into a string when stored. This can lead to invalid data when the cached string is then sent in a followup request if the original content was not intended to be a string. To avoid this problem, asset files are now explicitly not cached by karma's middleware.
Ref: https://github.com/karma-runner/karma/blob/84f85e7016efc2266fa6b3465f494a3fa151c85c/lib/middleware/common.js#L72

The internal karma common middleware that handles requests converts
the to be cached data into a string when stored. This can lead to invalid data
when the cached string is then sent in a followup request if the original content
was not intended to be a string. To avoid this  problem, asset files are now
explicitly not cached by karma's middleware.
Ref: https://github.com/karma-runner/karma/blob/84f85e7016efc2266fa6b3465f494a3fa151c85c/lib/middleware/common.js#L72
@clydin clydin force-pushed the karma/binary-assets branch from f99aa70 to b4bfa86 Compare May 1, 2025 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant