Skip to content

Commit

Permalink
Merge branch 'master' into LEGAL
Browse files Browse the repository at this point in the history
  • Loading branch information
Martii committed Jun 6, 2014
2 parents a9a3e2f + 932d1c9 commit 5478e27
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,6 @@ data
fakeS3
cert
aws.json
prod.sh

/iisnode
2 changes: 1 addition & 1 deletion app.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ app.configure(function(){
});

// Force HTTPS
if (process.env.NODE_ENV === 'production') {
if (app.get('port') === 443) {
app.use(function (req, res, next) {
res.setHeader('Strict-Transport-Security',
'max-age=8640000; includeSubDomains');
Expand Down
5 changes: 3 additions & 2 deletions libs/markdown.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
var marked = require('marked');
var hljs = require('highlight.js');
var xss = require('simple-xss');
var renderer = new marked.Renderer();

// Automatically generate an anchor for each header
Expand Down Expand Up @@ -29,11 +30,11 @@ marked.setOptions({
tables: true,
breaks: true,
pedantic: false,
sanitize: true,
sanitize: false, // we use xss to sanitize HTML
smartLists: true,
smartypants: false
});

exports.renderMd = function (text) {
return marked(text);
return xss(marked(text));
};
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"async": "*",
"aws-sdk": "*",
"toobusy-js": "*",
"simple-xss": "*",
"passport": "*",
"passport-github": "*",
"passport-amazon": "*",
Expand Down

0 comments on commit 5478e27

Please sign in to comment.