diff options
Diffstat (limited to 'lib/docx/files.js')
| -rw-r--r-- | lib/docx/files.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/docx/files.js b/lib/docx/files.js index 4b09b69..cb8655c 100644 --- a/lib/docx/files.js +++ b/lib/docx/files.js @@ -13,6 +13,15 @@ exports.uriToPath = uriToPath; function Files(options) { + options = options || {}; + if (!options.externalFileAccess) { + return { + read: function(uri) { + return promises.reject(new Error("could not read external image '" + uri + "', external file access is disabled")); + } + }; + } + var base = options.relativeToFile ? dirname(options.relativeToFile) : null; function read(uri, encoding) { |
