Skip to content

Conversation

matthewp
Copy link
Contributor

Changes

Testing

Added

Docs

N/A, bug fix.

When a cookie with an invalid value is present (e.g., containing invalid URI sequences), `Astro.cookies.get()` now returns the raw cookie value instead of throwing a URIError. This aligns with the behavior of the underlying `cookie` package and prevents crashes when manually-set or corrupted cookies are encountered.

Closes #14448
Copy link

changeset-bot bot commented Oct 17, 2025

🦋 Changeset detected

Latest commit: 8e3748d

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added the pkg: astro Related to the core `astro` package (scope) label Oct 17, 2025
Add test to verify that Astro.cookies.get() handles malformed cookie values gracefully by returning the unparsed value instead of throwing an error.
@matthewp matthewp marked this pull request as ready for review October 17, 2025 17:21
Copy link

codspeed-hq bot commented Oct 17, 2025

CodSpeed Performance Report

Merging #14566 will not alter performance

Comparing cookies-error-fix (8e3748d) with main (722bba0)

Summary

✅ 6 untouched

@matthewp matthewp merged commit 946fe68 into main Oct 17, 2025
22 checks passed
@matthewp matthewp deleted the cookies-error-fix branch October 17, 2025 20:38
@astrobot-houston astrobot-houston mentioned this pull request Oct 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pkg: astro Related to the core `astro` package (scope)

Projects

None yet

2 participants