headers/common/
location.rs1use HeaderValue;
2
3#[derive(Clone, Debug, PartialEq)]
24pub struct Location(HeaderValue);
25
26derive_header! {
27 Location(_),
28 name: LOCATION
29}
30
31#[cfg(test)]
32mod tests {
33 use super::super::test_decode;
34 use super::*;
35
36 #[test]
37 fn absolute_uri() {
38 let s = "http://www.example.net/index.html";
39 let loc = test_decode::<Location>(&[s]).unwrap();
40
41 assert_eq!(loc, Location(HeaderValue::from_static(s)));
42 }
43
44 #[test]
45 fn relative_uri_with_fragment() {
46 let s = "/People.html#tim";
47 let loc = test_decode::<Location>(&[s]).unwrap();
48
49 assert_eq!(loc, Location(HeaderValue::from_static(s)));
50 }
51}