diff --git a/src/routes/file.ts b/src/routes/file.ts index a44d7d3..21e3cd8 100644 --- a/src/routes/file.ts +++ b/src/routes/file.ts @@ -2,7 +2,13 @@ import * as fs from 'fs'; import {ReadStream} from 'fs'; export default { - test: (uri: string): boolean => /^\.|^\//.test(uri) || /^[a-zA-Z]:\\[\\\S|*\S]?.*$/g.test(uri), + test: (uri: string): boolean => { + if (process.platform === 'win32') { + return /^[a-zA-Z]:\\[\\\S|*\S]?.*$/g.test(uri); + } + + return /^\.|^\//.test(uri) + }, read: (path: string): Promise => { return new Promise((resolve, reject) => {