Skip to content

Read cached files as text unless type is "buffer"#91

Merged
zachleat merged 1 commit into
11ty:mainfrom
vrugtehagel:main
Jun 30, 2026
Merged

Read cached files as text unless type is "buffer"#91
zachleat merged 1 commit into
11ty:mainfrom
vrugtehagel:main

Conversation

@vrugtehagel

@vrugtehagel vrugtehagel commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

This PR resolves #90.

Previously, the cached file was read as text by default, unless type was explicitly set to "buffer". This was changed in 442070d.

JSON and parsed XML fetches flew under the radar here only because JSON.parse() converts its argument to a string implicily, which in the case of a buffer, happens to result in the desired behavior.

@vrugtehagel vrugtehagel changed the title Read files as text unless type is "buffer" Read cached files as text unless type is "buffer" Jun 11, 2026
@zachleat zachleat added this to the Fetch v5.1.3 milestone Jun 30, 2026
@zachleat zachleat merged commit fabf146 into 11ty:main Jun 30, 2026
12 checks passed
@zachleat

Copy link
Copy Markdown
Member

Shipping with v5.1.3 thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Cached text payloads are returned as buffers

2 participants