Skip to content

Commit 6a923d6

Browse files
Cache-control parsing doesn't handle quotes
1 parent 8db1b78 commit 6a923d6

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/common/cache_control.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -485,6 +485,20 @@ mod tests {
485485
);
486486
}
487487

488+
#[test]
489+
fn test_parse_quoted_comma() {
490+
assert_eq!(
491+
test_decode::<CacheControl>(&["foo=\"a, private, immutable, b\", no-cache"]).unwrap(),
492+
CacheControl::new()
493+
.with_no_cache()
494+
// These are wrong: these appear inside a quoted string and so
495+
// should be treated as parameter for the "a" directive.
496+
.with_private()
497+
.with_immutable(),
498+
"unknown extensions are ignored but shouldn't fail parsing",
499+
)
500+
}
501+
488502
#[test]
489503
fn test_parse_extension() {
490504
assert_eq!(

0 commit comments

Comments
 (0)