Skip to content

Commit

Permalink
fix(image): fix image doesn't exists, closes iamcco#397
Browse files Browse the repository at this point in the history
  • Loading branch information
iamcco committed May 13, 2022
1 parent a54e8db commit 239ea07
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions .vim/coc-settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"cSpell.words": [
"bufnr",
"chemzqm",
"mkdp",
"winheight",
Expand Down
2 changes: 1 addition & 1 deletion app/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ use(async (req, res, next) => {
}
}
logger.info('imgPath', imgPath)
if (fs.existsSync(imgPath)) {
if (fs.existsSync(imgPath) && !fs.statSync(imgPath).isDirectory()) {
if (imgPath.endsWith('svg')) {
res.setHeader('content-type', 'image/svg+xml')
}
Expand Down

0 comments on commit 239ea07

Please sign in to comment.