Use var instead of let, add var for value

This commit is contained in:
James 2019-09-24 09:18:35 -05:00 committed by GitHub
parent 6c8d4a386b
commit e33523e992
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,9 +2,10 @@
// Parse the cookie value for a CSRF token
var csrftoken;
var cookies = document.cookie.split(';').reduce((p, c) => {
let x = {};
let key = c.split('=')[0].trim();
x[key] = p[key] ? p[key].concat([c.split('=')[1]]) : [c.split('=')[1]];
var x = {};
var key = c.split('=')[0].trim();
var value = c.split('=')[1]
x[key] = p[key] ? p[key].concat([value]) : [value];
return Object.assign(p, x);
}, {});
// Collect the URL parameters