mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-03 00:15:11 +03:00
Fixed error when serving public images from servePublicFile
middleware
no issue - when `servePublicFile` middleware serves an image it resulted in a "Cannot set headers after they are sent to the client" error because `next()` was erroneously called for successful requests which then tripped the `prettyUrls` middleware which tries to perform a redirect - only calling `next()` when an error is present allows errors to be picked up by later middleware but successful requests end in the `servePublicFile` middleware
This commit is contained in:
parent
8def4fb402
commit
02c034068c
@ -30,7 +30,9 @@ function createPublicFileMiddleware(file, type, maxAge) {
|
||||
}));
|
||||
}
|
||||
|
||||
return next(err);
|
||||
if (err) {
|
||||
return next(err);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user