Commit 272a9d84 authored by baire's avatar baire
Browse files

support multiple lines inside undefined headers

parent c3251c3a
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -781,8 +781,9 @@ void UndefinedHeader::PreDecodeField (int id, Buffer& buffer) throw (DecodeError
{
	static Regex reg_header_name ("^" SIPREG_TOKEN);

	// TODO: match multiple-line extension header value
	static Regex reg_header_value ("^(" SIPREG_HCOLON ")([^\\r\\n]+)");
	// TODO: match properly UTF-8 characters
	// TODO: normalise the value ?...
	static Regex reg_header_value ("^(" SIPREG_HCOLON ")(([^\\r\\n]|" SIPREG_SWS ")*)");

	switch (id) {
	case id_headerName:
+3 −1
Original line number Diff line number Diff line
@@ -51,7 +51,9 @@ module Simple_Testcases
				"Via: SIP/2.0/UDP grabu.com" & c_CRLF &
				"Via: SIP/2.0/UDP pouic-pouic.com" & c_CRLF & 
				"Pouet: blah blah" & c_CRLF &
				"Via: SIP/2.0/UDP tutu.com" & c_CRLF 
				"Via: SIP/2.0/UDP tutu.com" & c_CRLF &
				"Pouet: blah blah again" & c_CRLF &
				" on multiple lines" & c_CRLF
				);
	
		alt {