Skip to content

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

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

Open
wants to merge 1 commit into
base: 19.2.x
Choose a base branch
from

Conversation

clydin
Copy link
Member

@clydin clydin commented May 2, 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

(cherry picked from commit 90d1db3)

Closes #30198

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

(cherry picked from commit 90d1db3)
@clydin clydin added the target: patch This PR is targeted for the next patch release label May 2, 2025
@clydin clydin linked an issue May 2, 2025 that may be closed by this pull request
1 task
@clydin clydin requested a review from jkrems May 2, 2025 21:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: @angular/build target: patch This PR is targeted for the next patch release
2 participants