mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-06 22:40:14 -05:00
Handle content requests with overly long filenames
no issue - a request for a filename longer than those allowed by the filesystem produced a ENAMETOOLONG error, which would end up becoming a 500 error from Ghost - this catches the error and returns a HTTP 400 Bad Request response
This commit is contained in:
parent
e9e3f58792
commit
a671ad4707
1 changed files with 4 additions and 0 deletions
|
@ -171,6 +171,10 @@ class LocalFileStore extends StorageBase {
|
|||
}));
|
||||
}
|
||||
|
||||
if (err.code === 'ENAMETOOLONG') {
|
||||
return reject(new common.errors.BadRequestError({err: err}));
|
||||
}
|
||||
|
||||
return reject(new common.errors.GhostError({
|
||||
err: err,
|
||||
message: common.i18n.t('errors.errors.cannotReadImage', {img: options.path})
|
||||
|
|
Loading…
Reference in a new issue