Support Proxy-Authorization header
authorRichard Whitehouse <github@richardwhiuk.com>
Sun, 29 Oct 2017 20:13:12 +0000 (20:13 +0000)
committerRichard Whitehouse <github@richardwhiuk.com>
Sun, 29 Oct 2017 20:13:12 +0000 (20:13 +0000)
src/codec.rs
src/parser.rs
src/types.rs

index 4b292a844ac99628c50249a3bbdd5856a442f4ca..223f5ed2da31946dc314c061db4bf345f3958fee 100644 (file)
@@ -441,7 +441,8 @@ mod tests {
                            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\nOrganization:Foobar\r\nPriority:normal\r\nProxy-Authenticate:\
-                           Digest realm=\"atlanta.com\"\r\nVia: localhost\r\n\r\n")
+                           Digest realm=\"atlanta.com\"\r\nProxy-Authorization:Digest \
+                           username=\"Bob\"\r\nVia: localhost\r\n\r\n")
         });
 
         let finished = request.and_then(|(socket, _request)| {
index ac051a71b51422769807351e68a2e42d319ad0cb..e7738d72490b1202da48ae6361f81c48d83de003 100644 (file)
@@ -1033,6 +1033,10 @@ named!(proxy_authenticate_header<Challenge>, preceded!(
        tag!(b"Proxy-Authenticate:"),
        challenge));
 
+named!(proxy_authorization_header<Credentials>, preceded!(
+       tag!(b"Proxy-Authorization:"),
+       credentials));
+
 named!(pub header<Header>, alt!(
 // RFC 3261 Headers
        accept_header => { |a| Header::Accept(a) } |
@@ -1061,5 +1065,6 @@ named!(pub header<Header>, alt!(
        min_expires_header => { |m| Header::MinExpires(m) } |
        organization_header => { |o| Header::Organization(o) } |
        priority_header => { |p| Header::Priority(p) } |
-       proxy_authenticate_header => { |p| Header::ProxyAuthenticate(p) }
+       proxy_authenticate_header => { |p| Header::ProxyAuthenticate(p) } |
+       proxy_authorization_header => { |p| Header::ProxyAuthorization(p) }
 ));
index 6a48c4a285dadea07fa628207ad29828e892ccf5..201379d7dfaa44ca40519601c2d1d9c367b7fb94 100644 (file)
@@ -402,6 +402,7 @@ pub enum Header {
     Organization(Vec<u8>),
     Priority(Priority),
     ProxyAuthenticate(Challenge),
+    ProxyAuthorization(Credentials),
     To(Uri),
     Extension { name: String, value: String },
 }