summaryrefslogtreecommitdiff
path: root/lib/config
diff options
context:
space:
mode:
authorChristoph (Sheogorath) Kern2018-01-23 12:10:33 +0100
committerGitHub2018-01-23 12:10:33 +0100
commit584f1c524904147df41d642db6303a13c968e6d1 (patch)
tree07f4cda1da15e214801138ea80581f7ec9e1e94f /lib/config
parente0389bc4cf21da4dac0f42b9f2a6d3cdf5b0d669 (diff)
parenta7935a595a6d482aaefb5a3c9fa0600adf2d2c5b (diff)
Merge pull request #691 from SISheogorath/feature/upload
Allow more detailed configuration of upload mime types
Diffstat (limited to 'lib/config')
-rw-r--r--lib/config/index.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/config/index.js b/lib/config/index.js
index 3d22c3c3..4f6b4b6a 100644
--- a/lib/config/index.js
+++ b/lib/config/index.js
@@ -97,6 +97,26 @@ config.isLDAPEnable = config.ldap.url
config.isSAMLEnable = config.saml.idpSsoUrl
config.isPDFExportEnable = config.allowpdfexport
+// figure out mime types for image uploads
+switch (config.imageUploadType) {
+ case 'imgur':
+ config.allowedUploadMimeTypes = [
+ 'image/jpeg',
+ 'image/png',
+ 'image/jpg',
+ 'image/gif'
+ ]
+ break
+ default:
+ config.allowedUploadMimeTypes = [
+ 'image/jpeg',
+ 'image/png',
+ 'image/jpg',
+ 'image/gif',
+ 'image/svg+xml'
+ ]
+}
+
// generate correct path
config.sslcapath.forEach(function (capath, i, array) {
array[i] = path.resolve(appRootPath, capath)