Skip to content

Commit

Permalink
Merge pull request #114 from AlexandreBeaurain/master
Browse files Browse the repository at this point in the history
fix: bad cookies can crash process
  • Loading branch information
gregorybesson committed Jan 9, 2017
2 parents 8b7e75a + 13f3fa1 commit 68085c8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/server/routes/get-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function renderAbeAdmin(EditorVariables, obj, filePath) {
var editorWidth = '33%'
EditorVariables.express.req.headers && EditorVariables.express.req.headers.cookie && EditorVariables.express.req.headers.cookie.split(';').forEach(function(cookie) {
var parts = cookie.match(/(.*?)=(.*)$/)
if(parts[1] === 'editorWidth') editorWidth = parts[2]
if ( parts && ( parts.length > 2 ) && ( parts[1] === 'editorWidth' ) ) editorWidth = parts[2]
})

EditorVariables.pageHtml = pageHtml
Expand Down Expand Up @@ -173,4 +173,4 @@ var route = function(req, res, next) {
})
}

export default route
export default route

0 comments on commit 68085c8

Please sign in to comment.