summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/config/environment.js2
-rw-r--r--lib/config/hackmdEnvironment.js2
-rw-r--r--lib/letter-avatars.js1
3 files changed, 3 insertions, 2 deletions
diff --git a/lib/config/environment.js b/lib/config/environment.js
index a57fe0db..fc757cf1 100644
--- a/lib/config/environment.js
+++ b/lib/config/environment.js
@@ -14,7 +14,7 @@ module.exports = {
useSSL: toBooleanConfig(process.env.CMD_USESSL),
hsts: {
enable: toBooleanConfig(process.env.CMD_HSTS_ENABLE),
- maxAgeSeconds: process.env.CMD_HSTS_MAX_AGE,
+ maxAgeSeconds: toIntegerConfig(process.env.CMD_HSTS_MAX_AGE),
includeSubdomains: toBooleanConfig(process.env.CMD_HSTS_INCLUDE_SUBDOMAINS),
preload: toBooleanConfig(process.env.CMD_HSTS_PRELOAD)
},
diff --git a/lib/config/hackmdEnvironment.js b/lib/config/hackmdEnvironment.js
index e1c11569..bc20e58a 100644
--- a/lib/config/hackmdEnvironment.js
+++ b/lib/config/hackmdEnvironment.js
@@ -10,7 +10,7 @@ module.exports = {
useSSL: toBooleanConfig(process.env.HMD_USESSL),
hsts: {
enable: toBooleanConfig(process.env.HMD_HSTS_ENABLE),
- maxAgeSeconds: process.env.HMD_HSTS_MAX_AGE,
+ maxAgeSeconds: toIntegerConfig(process.env.HMD_HSTS_MAX_AGE),
includeSubdomains: toBooleanConfig(process.env.HMD_HSTS_INCLUDE_SUBDOMAINS),
preload: toBooleanConfig(process.env.HMD_HSTS_PRELOAD)
},
diff --git a/lib/letter-avatars.js b/lib/letter-avatars.js
index 7d463950..a5dd8207 100644
--- a/lib/letter-avatars.js
+++ b/lib/letter-avatars.js
@@ -30,6 +30,7 @@ exports.generateAvatarURL = function (name, email = '', big = true) {
if (typeof email !== 'string') {
email = '' + name + '@example.com'
}
+ name=encodeURIComponent(name)
let hash = crypto.createHash('md5')
hash.update(email.toLowerCase())