From 622ed285b029dfa3b65cc3f13b51c1e0b83262b9 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Sat, 22 Feb 2025 12:25:32 +0100 Subject: fix things --- sip/src/encoding/mod.rs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'sip/src/encoding/mod.rs') diff --git a/sip/src/encoding/mod.rs b/sip/src/encoding/mod.rs index 816aa01..3c2f3fd 100644 --- a/sip/src/encoding/mod.rs +++ b/sip/src/encoding/mod.rs @@ -1,5 +1,6 @@ use std::{fmt::Display, str::FromStr}; +use headers::ContentLength; use request::Request; use response::Response; @@ -43,4 +44,10 @@ impl Message { Message::Response(r) => &mut r.body, } } + pub fn content_length(&self) -> Option> { + match self { + Message::Request(r) => r.headers.get::(), + Message::Response(r) => r.headers.get::(), + } + } } -- cgit v1.2.3-70-g09d2