hyperx/header/common/
server.rs

1header! {
2    /// `Server` header, defined in [RFC7231](http://tools.ietf.org/html/rfc7231#section-7.4.2)
3    ///
4    /// The `Server` header field contains information about the software
5    /// used by the origin server to handle the request, which is often used
6    /// by clients to help identify the scope of reported interoperability
7    /// problems, to work around or tailor requests to avoid particular
8    /// server limitations, and for analytics regarding server or operating
9    /// system use.  An origin server MAY generate a Server field in its
10    /// responses.
11    ///
12    /// # ABNF
13    ///
14    /// ```text
15    /// Server = product *( RWS ( product / comment ) )
16    /// ```
17    ///
18    /// # Example values
19    /// * `CERN/3.0 libwww/2.17`
20    ///
21    /// # Example
22    ///
23    /// ```
24    /// # extern crate http;
25    /// use hyperx::header::{Server, TypedHeaders};
26    ///
27    /// let mut headers = http::HeaderMap::new();
28    /// headers.encode(&Server::new("hyper/0.5.2"));
29    /// ```
30    // TODO: Maybe parse as defined in the spec?
31    (Server, "Server") => Cow[str]
32
33    test_server {
34        // Testcase from RFC
35        test_header!(test1, vec![b"CERN/3.0 libwww/2.17"]);
36    }
37}
38
39bench_header!(bench, Server, { vec![b"Some String".to_vec()] });
40
41standard_header!(Server, SERVER);