mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Revert cookie encoding behavior
This commit is contained in:
parent
888e7ee023
commit
2037741b54
@ -148,16 +148,9 @@ module.exports = function(RED) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
if (opts.headers.hasOwnProperty('cookie')) {
|
if (opts.headers.hasOwnProperty('cookie')) {
|
||||||
var cookies = cookie.parse(opts.headers.cookie);
|
var cookies = cookie.parse(opts.headers.cookie, {decode:String});
|
||||||
for (var name in cookies) {
|
for (var name in cookies) {
|
||||||
if (cookies.hasOwnProperty(name)) {
|
opts.jar.setCookie(cookie.serialize(name, cookies[name], {encode:String}), url);
|
||||||
if (cookies[name] === null) {
|
|
||||||
// This case clears a cookie for HTTP In/Response nodes.
|
|
||||||
// Ignore for this node.
|
|
||||||
} else {
|
|
||||||
opts.jar.setCookie(name + '=' + cookies[name], url);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
delete opts.headers.cookie;
|
delete opts.headers.cookie;
|
||||||
}
|
}
|
||||||
@ -168,9 +161,9 @@ module.exports = function(RED) {
|
|||||||
// This case clears a cookie for HTTP In/Response nodes.
|
// This case clears a cookie for HTTP In/Response nodes.
|
||||||
// Ignore for this node.
|
// Ignore for this node.
|
||||||
} else if (typeof msg.cookies[name] === 'object') {
|
} else if (typeof msg.cookies[name] === 'object') {
|
||||||
opts.jar.setCookie(name + '=' + msg.cookies[name].value, url);
|
opts.jar.setCookie(cookie.serialize(name, msg.cookies[name].value), url);
|
||||||
} else {
|
} else {
|
||||||
opts.jar.setCookie(name + '=' + msg.cookies[name], url);
|
opts.jar.setCookie(cookie.serialize(name, msg.cookies[name]), url);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user