Skip to content

Commit b916a7b

Browse files
committed
Merge pull request #501 from pyfisch/from
feat(headers): Add From header field
2 parents ec13f98 + ce9c4af commit b916a7b

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

src/header/common/from.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
header! {
2+
#[doc="`From` header, defined in [RFC7231](http://tools.ietf.org/html/rfc7231#section-5.5.1)"]
3+
#[doc=""]
4+
#[doc="The `From` header field contains an Internet email address for a"]
5+
#[doc="human user who controls the requesting user agent. The address ought"]
6+
#[doc="to be machine-usable."]
7+
#[doc="# ABNF"]
8+
#[doc="```plain"]
9+
#[doc="From = mailbox"]
10+
#[doc="mailbox = <mailbox, see [RFC5322], Section 3.4>"]
11+
#[doc="```"]
12+
// FIXME: Maybe use mailbox?
13+
(From, "From") => [String]
14+
15+
test_from {
16+
test_header!(test1, vec![b"[email protected]"]);
17+
}
18+
}

src/header/common/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ pub use self::date::Date;
3030
pub use self::etag::ETag;
3131
pub use self::expect::Expect;
3232
pub use self::expires::Expires;
33+
pub use self::from::From;
3334
pub use self::host::Host;
3435
pub use self::if_match::IfMatch;
3536
pub use self::if_modified_since::IfModifiedSince;
@@ -330,6 +331,7 @@ mod date;
330331
mod etag;
331332
mod expect;
332333
mod expires;
334+
mod from;
333335
mod host;
334336
mod if_match;
335337
mod if_modified_since;

0 commit comments

Comments
 (0)