Skip to content

Commit

Permalink
fix cache invalidation in HttpUriPlugin
Browse files Browse the repository at this point in the history
- should not store partial result when following redirect
  • Loading branch information
vankop committed Feb 10, 2022
1 parent 0d38e57 commit a6099c4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
9 changes: 9 additions & 0 deletions lib/schemes/HttpUriPlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,15 @@ class HttpUriPlugin {
logger.debug(
`GET ${url} [${res.statusCode}] -> ${partialResult.location}`
);
// we should follow redirect and not store partial result
return callback(null, {
...partialResult,
storeLock,
storeCache,
fresh: true,
etag: undefined,
validUntil: undefined
});
} else {
logger.debug(
`GET ${url} [${res.statusCode}] ${Math.ceil(
Expand Down
5 changes: 0 additions & 5 deletions test/ConfigCacheTestCases.longtest.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,6 @@ describeCases({
// Pack got invalid because of write to: TerserWebpackPlugin|bundle0.js
category: "assets",
test: "delete-asset"
},
{
// Pack got invalid because of write to: webpack.HttpUriPlugin|https://raw.githubusercontent.com//webpack//webpack//main/CODE_OF_CONDUCT.md
category: "asset-modules",
test: "http-url"
}
],
filter: [logErrors.PERSISTENCE_CACHE_INVALIDATE_ERROR]
Expand Down

0 comments on commit a6099c4

Please sign in to comment.