From: Richard Whitehouse Date: Sun, 29 Oct 2017 20:13:12 +0000 (+0000) Subject: Support Proxy-Authorization header X-Git-Url: https://git.richardwhiuk.com/?a=commitdiff_plain;h=395a128f4f7a5f9a308adba7b17f3f090e25ad3f;p=rust-sip.git Support Proxy-Authorization header --- diff --git a/src/codec.rs b/src/codec.rs index 4b292a8..223f5ed 100644 --- a/src/codec.rs +++ b/src/codec.rs @@ -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)| { diff --git a/src/parser.rs b/src/parser.rs index ac051a7..e7738d7 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -1033,6 +1033,10 @@ named!(proxy_authenticate_header, preceded!( tag!(b"Proxy-Authenticate:"), challenge)); +named!(proxy_authorization_header, preceded!( + tag!(b"Proxy-Authorization:"), + credentials)); + named!(pub header
, alt!( // RFC 3261 Headers accept_header => { |a| Header::Accept(a) } | @@ -1061,5 +1065,6 @@ named!(pub 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) } )); diff --git a/src/types.rs b/src/types.rs index 6a48c4a..201379d 100644 --- a/src/types.rs +++ b/src/types.rs @@ -402,6 +402,7 @@ pub enum Header { Organization(Vec), Priority(Priority), ProxyAuthenticate(Challenge), + ProxyAuthorization(Credentials), To(Uri), Extension { name: String, value: String }, }