hyperx/header/common/
access_control_max_age.rs

1header! {
2    /// `Access-Control-Max-Age` header, part of
3    /// [CORS](http://www.w3.org/TR/cors/#access-control-max-age-response-header)
4    ///
5    /// The `Access-Control-Max-Age` header indicates how long the results of a
6    /// preflight request can be cached in a preflight result cache.
7    ///
8    /// # ABNF
9    ///
10    /// ```text
11    /// Access-Control-Max-Age = \"Access-Control-Max-Age\" \":\" delta-seconds
12    /// ```
13    ///
14    /// # Example values
15    ///
16    /// * `531`
17    ///
18    /// # Examples
19    ///
20    /// ```
21    /// # extern crate http;
22    /// use hyperx::header::{AccessControlMaxAge, TypedHeaders};
23    ///
24    /// let mut headers = http::HeaderMap::new();
25    /// headers.encode(&AccessControlMaxAge(1728000u32));
26    /// ```
27    (AccessControlMaxAge, "Access-Control-Max-Age") => [u32]
28
29    test_access_control_max_age {
30        test_header!(test1, vec![b"531"]);
31    }
32}
33
34standard_header!(AccessControlMaxAge, ACCESS_CONTROL_MAX_AGE);