Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix language switch #351

Open
wwwcase opened this issue May 26, 2020 · 0 comments
Open

Fix language switch #351

wwwcase opened this issue May 26, 2020 · 0 comments

Comments

@wwwcase
Copy link

wwwcase commented May 26, 2020

in utils.js reverse split (dublicates cookie lang=xx in request.headers.cookie) :
exports.parseCookies = function(request) {
if (!request || !request.headers)
return {};
var list = {},
rc = request.headers.cookie;
//rc && rc.split(';').forEach(function( cookie ) {
rc && rc.split(';').reverse().forEach(function( cookie ) {
var parts = cookie.split('=');
list[parts.shift().trim()] = decodeURI(parts.join('='));
});
return list;
};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant