Ignore session cookie on Inform

Some devices preserve cookies set in a previous session and pass them
on to the next session. The presence of a session cookie in the Inform
request causes an unnecessary DB query and, in some edge cases, an
Invalid Session error.
This commit is contained in:
Zaid Abdulla committed 2021-09-16 13:27:37 -07:00
1 parent bc2d258f9c
commit ca83704958
2 files changed
+120 -151

No files matched your search

+2 -3
View File
@@ -827,14 +827,13 @@ function fault(xml: Element): CpeFault {
export function request(
body: string,
cwmpVersion: string,
warn: Record<string, unknown>[]
): SoapMessage {
warnings = warn;
const rpc = {
id: null,
cwmpVersion: cwmpVersion,
cwmpVersion: null,
sessionTimeout: null,
cpeRequest: null,
cpeFault: null,
@@ -877,7 +876,7 @@ export function request(
const methodElement = bodyElement.children[0];
if (!rpc.cwmpVersion && methodElement.localName !== "Fault") {
if (methodElement.localName === "Inform") {
let namespace, namespaceHref;
for (const e of [methodElement, bodyElement, envelope]) {
namespace = namespace || e.namespace;