mirror of
https://github.com/vitejs/vite.git
synced 2024-11-22 07:09:05 +00:00
Co-authored-by: coderwei <65948611+coderwei99@users.noreply.github.com>
This commit is contained in:
parent
d90ba40474
commit
74a79c53b2
@ -52,7 +52,10 @@ export function cachedTransformMiddleware(
|
||||
const ifNoneMatch = req.headers['if-none-match']
|
||||
if (ifNoneMatch) {
|
||||
const moduleByEtag = server.moduleGraph.getModuleByEtag(ifNoneMatch)
|
||||
if (moduleByEtag?.transformResult?.etag === ifNoneMatch) {
|
||||
if (
|
||||
moduleByEtag?.transformResult?.etag === ifNoneMatch &&
|
||||
moduleByEtag?.url === req.url
|
||||
) {
|
||||
// For CSS requests, if the same CSS file is imported in a module,
|
||||
// the browser sends the request for the direct CSS request with the etag
|
||||
// from the imported CSS module. We ignore the etag in this case.
|
||||
|
Loading…
Reference in New Issue
Block a user