hyper_sync/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 /// use hyper_sync::header::{Headers, Server};
25 ///
26 /// let mut headers = Headers::new();
27 /// headers.set(Server::new("hyper_sync/0.5.2"));
28 /// ```
29 // TODO: Maybe parse as defined in the spec?
30 (Server, "Server") => Cow[str]
31
32 test_server {
33 // Testcase from RFC
34 test_header!(test1, vec![b"CERN/3.0 libwww/2.17"]);
35 }
36}
37
38bench_header!(bench, Server, { vec![b"Some String".to_vec()] });