cogo_http/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 /// ```plain
14 /// Server = product *( RWS ( product / comment ) )
15 /// ```
16 ///
17 /// # Example values
18 /// * `CERN/3.0 libwww/2.17`
19 ///
20 /// # Example
21 /// ```
22 /// use cogo_http::header::{Headers, Server};
23 ///
24 /// let mut headers = Headers::new();
25 /// headers.set(Server("hyper/0.5.2".to_owned()));
26 /// ```
27 // TODO: Maybe parse as defined in the spec?
28 (Server, "Server") => [String]
29
30 test_server {
31 // Testcase from RFC
32 test_header!(test1, vec![b"CERN/3.0 libwww/2.17"]);
33 }
34}
35
36bench_header!(bench, Server, { vec![b"Some String".to_vec()] });