Skip to content

Commit f99aa70

Browse files
committed
fix(@angular/build): avoid internal karma request cache for assets
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
1 parent 23124c5 commit f99aa70

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/angular/build/src/builders/karma/application_builder.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ class AngularAssetsMiddleware {
8686

8787
switch (file.origin) {
8888
case 'disk':
89-
this.serveFile(file.inputPath, undefined, res);
89+
this.serveFile(file.inputPath, undefined, res, undefined, undefined, true);
9090
break;
9191
case 'memory':
9292
// Include pathname to help with Content-Type headers.

0 commit comments

Comments
 (0)