Support for Organization header
authorRichard Whitehouse <github@richardwhiuk.com>
Sun, 29 Oct 2017 19:30:26 +0000 (19:30 +0000)
committerRichard Whitehouse <github@richardwhiuk.com>
Sun, 29 Oct 2017 19:30:26 +0000 (19:30 +0000)
src/codec.rs
src/parser.rs
src/types.rs

index f02ecc6fcaa401d5c61d5bf866a109c3f8faba0a..42afee13d6d1526d10081bf066843df921a98cd8 100644 (file)
@@ -440,7 +440,7 @@ mod tests {
                            com>\r\nExpires:30\r\nFrom:sip:+12125551212@server.phone2net.com;\
                            tag=887s\r\nIn-Reply-To:70710@saturn.bell-tel.com,17320@saturn.\
                            bell-tel.com\r\nMax-Forwards:32\r\nMIME-Version:2.0\r\nMin-Expires:\
-                           30\r\nVia: localhost\r\n\r\n")
+                           30\r\nOrganization:Foobar\r\nVia: localhost\r\n\r\n")
         });
 
         let finished = request.and_then(|(socket, _request)| {
index 9e71d9ed22943ceb448bee245d75143b47a33368..daccfea978caefa4d7bde97e996989e07654ac0b 100644 (file)
@@ -975,6 +975,10 @@ named!(min_expires_header<u32>, preceded!(
        tag!(b"Min-Expires:"),
        number));
 
+named!(organization_header<Vec<u8>>, preceded!(
+       tag!(b"Organization:"),
+       word));
+
 named!(pub header<Header>, alt!(
 // RFC 3261 Headers
        accept_header => { |a| Header::Accept(a) } |
@@ -1000,5 +1004,6 @@ named!(pub header<Header>, alt!(
        in_reply_to_header => { |i| Header::InReplyTo(i) } |
        max_forwards_header => { |m| Header::MaxForwards(m) } |
        mime_version_header => { |(m, v)| Header::MimeVersion(m, v) } |
-       min_expires_header => { |m| Header::MinExpires(m) }
+       min_expires_header => { |m| Header::MinExpires(m) } |
+       organization_header => { |o| Header::Organization(o) }
 ));
index daec3640d6ceb318797a5b2bbf6e196c6d4e06bd..72ac56d780d9883d45e22f6c5b2a5bfa0e85ac5c 100644 (file)
@@ -367,6 +367,7 @@ pub enum Header {
     MaxForwards(u32),
     MimeVersion(u32, u32),
     MinExpires(u32),
+    Organization(Vec<u8>),
     To(Uri),
     Extension { name: String, value: String },
 }