I’m seeing ~30% of cookies having stripped bytes:
CREATE TEMPORARY FUNCTION extractHeader(payload STRING, name STRING)
RETURNS STRING LANGUAGE js AS '''
try {
var $ = JSON.parse(payload);
var header = $._headers.response.find(h => h.toLowerCase().startsWith(name.toLowerCase()));
if (!header) {
return null;
}
return header.substr(header.indexOf(':') + 1).trim();
} catch (e) {
return null;
}
''';
SELECT
COUNTIF(REGEXP_CONTAINS(cookie, r'bytes were stripped')) AS stripped_bytes,
COUNT(0) AS total_reqs,
COUNTIF(REGEXP_CONTAINS(cookie, r'bytes were stripped')) / COUNT(0) AS pct_stripped_bytes
FROM (
SELECT
extractHeader(payload, 'Set-Cookie') AS cookie
FROM
`httparchive.requests.2020_06_01_mobile`)
WHERE
cookie IS NOT NULL
stripped_bytes | total_reqs | pct_stripped_bytes |
---|---|---|
19,671,309 | 68,839,626 | 28.58% |