Skip to content

[6.x] Tolerate a folded X-Statamic-Pagination header when warming#14882

Open
mynetx wants to merge 1 commit into
statamic:6.xfrom
mynetx:fix/static-warm-folded-pagination-header
Open

[6.x] Tolerate a folded X-Statamic-Pagination header when warming#14882
mynetx wants to merge 1 commit into
statamic:6.xfrom
mynetx:fix/static-warm-folded-pagination-header

Conversation

@mynetx

@mynetx mynetx commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Running statamic:static:warm crashes with Undefined array key 1 when it warms a paginated page behind a proxy or CDN. The static caching middleware sets X-Statamic-Pagination as three separate header values, but a proxy may fold repeated headers into a single comma-joined line, so getHeader() returns one element and the [$current, $total, $name] = … destructure blows up. The --queue path hits the same thing.

A small NormalizesPaginationHeader trait normalizes both framings before destructuring, keeping a page name that itself contains a comma intact. The middleware always emits three values, so the helper assumes three.

Fixes #14857

A proxy or CDN can fold the three X-Statamic-Pagination header values
into a single comma-joined line, so statamic:static:warm and its queued
job threw an Undefined array key error when destructuring it. Normalize
both framings before destructuring, keeping a page name that contains a
comma intact.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

statamic:static:warm crashes with "Undefined array key 1" when a proxy folds the X-Statamic-Pagination header

1 participant