We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fbaed33 commit ced4aaeCopy full SHA for ced4aae
src/conditional/vary.rs
@@ -102,6 +102,13 @@ impl Vary {
102
};
103
}
104
105
+ if self.wildcard {
106
+ match output.len() {
107
+ 0 => write!(output, "*").unwrap(),
108
+ _ => write!(output, ", *").unwrap(),
109
+ };
110
+ }
111
+
112
// SAFETY: the internal string is validated to be ASCII.
113
unsafe { HeaderValue::from_bytes_unchecked(output.into()) }
114
@@ -262,7 +269,7 @@ mod test {
262
269
fn wildcard() -> crate::Result<()> {
263
270
let mut entries = Vary::new();
264
271
entries.push("User-Agent")?;
265
- entries.push("*")?;
272
+ entries.set_wildcard(true);
266
273
267
274
let mut res = Response::new(200);
268
275
entries.apply(&mut res);
0 commit comments