withastro
astro
BlogDocsChangelog

Fix: handle malformed cookies gracefully

#14566Merged
Comparing
cookies-error-fix
(
8e3748d
) with
main
(
722bba0
)
CodSpeed Performance Gauge
0%
Untouched
6

Benchmarks

Passed

Rendering: streaming [true], .astro file
benchmark/bench/codspeed.bench.js::Bench rendering
CodSpeed Performance Gauge
0%
943.1 ms938.6 ms
Rendering: streaming [true], .md file
benchmark/bench/codspeed.bench.js::Bench rendering
CodSpeed Performance Gauge
0%
12.8 ms12.8 ms
Rendering: streaming [false], .astro file
benchmark/bench/codspeed.bench.js::Bench rendering
CodSpeed Performance Gauge
0%
891.9 ms892.6 ms
Rendering: streaming [false], .md file
benchmark/bench/codspeed.bench.js::Bench rendering
CodSpeed Performance Gauge
0%
12.9 ms12.9 ms
Rendering: streaming [false], .mdx file
benchmark/bench/codspeed.bench.js::Bench rendering
CodSpeed Performance Gauge
0%
717.3 ms718.6 ms
Rendering: streaming [true], .mdx file
benchmark/bench/codspeed.bench.js::Bench rendering
CodSpeed Performance Gauge
0%
722 ms723.8 ms

Commits

Click on a commit to change the comparison range
Base
main
722bba0
+0.11%
Fix: handle malformed cookies gracefully 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
8b465dc
4 days ago
by matthewp
-0.14%
test: add unit test for malformed cookie handling Add test to verify that Astro.cookies.get() handles malformed cookie values gracefully by returning the unparsed value instead of throwing an error.
8e3748d
4 days ago
by matthewp
© 2025 CodSpeed Technology
Home Terms Privacy Docs