Consent log endpoint: body capped at 4 KiB (413), version bounded by the policy version; consent-log-migration a warning

Review C-1: the endpoint, on on every site, parsed a 20 MB body. It now refuses a content-length over
CONSENT_LOG_MAX_BYTES (4096) before reading and reads the stream only up to the cap (readCappedBody), so a missing or
false length cannot make it hold more. A version above Cookie settings' policy version is 400 (the cached version is
read again once, for an editor's fresh raise); versions from 1 up are accepted (pages rendered before a raise).
Review C-2: consent-log-migration is a warning, like every consent check of 1.17.0 (the owner's decision).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
Radosław Smoliński
2026-11-26 14:10:44 +01:00
co-authored by Claude Opus 5.5
parent 9a448ba5df
commit 963464d6cb
10 changed files with 147 additions and 21 deletions
+2
View File
@@ -79,6 +79,7 @@ export {
CONSENT_COOKIE,
CONSENT_FALLBACK,
CONSENT_FALLBACK_PL,
CONSENT_LOG_MAX_BYTES,
CONSENT_LOG_PATH,
CONSENT_LOG_SLUG,
CONSENT_MAX_AGE,
@@ -95,6 +96,7 @@ export {
gpcFromNavigator,
gpcWellKnown,
parseConsent,
readCappedBody,
readConsentRecord,
REJECT_ALL_CONSENT,
resolveConsent,