fix: emit qdreader ck as upstream json map
This commit is contained in:
@@ -23,9 +23,12 @@ function run({ cookie = '', body = '', headerName = 'Cookie' }) {
|
||||
|
||||
{
|
||||
const qdheader = Buffer.from('123456|device|more').toString('base64').replace(/=+$/, '');
|
||||
const { notices } = run({ cookie: `QDHeader=${encodeURIComponent(qdheader)}; QDH=abc` });
|
||||
const cookie = `QDHeader=${encodeURIComponent(qdheader)}; QDH=abc`;
|
||||
const { notices } = run({ cookie });
|
||||
assert.equal(notices[0][1], '抓取成功');
|
||||
assert.match(notices[0][2], /^启点ck /);
|
||||
const body = notices[0][2];
|
||||
assert.match(body, /^启点ck /);
|
||||
assert.deepEqual(JSON.parse(body.replace(/^启点ck\s+/, '')), { '123456': cookie });
|
||||
assert.equal(notices[0].length, 3);
|
||||
}
|
||||
|
||||
@@ -58,7 +61,7 @@ function run({ cookie = '', body = '', headerName = 'Cookie' }) {
|
||||
body: JSON.stringify({ Data: { Guid: '120098575768', UserId: '475700975' }, Result: '0' }),
|
||||
});
|
||||
assert.equal(notices[0][1], '抓取成功');
|
||||
assert.match(notices[0][2], /^启点ck /);
|
||||
assert.deepEqual(JSON.parse(notices[0][2].replace(/^启点ck\s+/, '')), { '475700975': `QDHeader=${streamQdheader}; ywguid=120098575768; QDH=abc` });
|
||||
}
|
||||
|
||||
{
|
||||
@@ -69,7 +72,7 @@ function run({ cookie = '', body = '', headerName = 'Cookie' }) {
|
||||
});
|
||||
assert.equal(notices[0][0], '启点读书');
|
||||
assert.equal(notices[0][1], '抓取成功');
|
||||
assert.equal(notices[0][2], '启点ck cmfuToken=abc; QDH=def');
|
||||
assert.equal(notices[0][2], '启点ck {"135790":"cmfuToken=abc; QDH=def"}');
|
||||
assert.equal(notices[0].length, 3);
|
||||
assert.equal(JSON.stringify(donePayloads[0]), '{}');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user