Skip to content

Commit

Permalink
Merge pull request #151 from engineerapart/master
Browse files Browse the repository at this point in the history
Fix cookie set crash on newer versions of express
  • Loading branch information
jamuhl authored Jul 1, 2018
2 parents c9a6c44 + 71e1bf3 commit 09f1a03
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/languageLookups/cookie.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default {
},

cacheUserLanguage(req, res, lng, options = {}) {
if (options.lookupCookie && req !== 'undefined' && !res._headerSent) {
if (options.lookupCookie && req !== 'undefined' && !(res._headerSent || res.headersSent)) {
const cookies = new Cookies(req, res);

let expirationDate = options.cookieExpirationDate;
Expand Down

0 comments on commit 09f1a03

Please sign in to comment.