From bd0cac18b324b996862533b3d2077935eaab054e Mon Sep 17 00:00:00 2001 From: aler9 <46489434+aler9@users.noreply.github.com> Date: Thu, 18 Mar 2021 20:09:06 +0100 Subject: [PATCH] base: fix encoding/decoding of RTP-Info header --- pkg/base/header.go | 2 +- pkg/base/header_test.go | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/pkg/base/header.go b/pkg/base/header.go index f84f683d..f8aea142 100644 --- a/pkg/base/header.go +++ b/pkg/base/header.go @@ -17,7 +17,7 @@ const ( func headerKeyNormalize(in string) string { switch strings.ToLower(in) { case "rtp-info": - return "RTP-INFO" + return "RTP-Info" case "www-authenticate": return "WWW-Authenticate" diff --git a/pkg/base/header_test.go b/pkg/base/header_test.go index 14c691f7..e4092794 100644 --- a/pkg/base/header_test.go +++ b/pkg/base/header_test.go @@ -64,8 +64,8 @@ var casesHeader = []struct { }, { "normalized keys, standard", - []byte("Content-type: testing\r\n" + - "Content-length: value\r\n" + + []byte("content-type: testing\r\n" + + "content-length: value\r\n" + "\r\n"), []byte("Content-Length: value\r\n" + "Content-Type: testing\r\n" + @@ -77,14 +77,17 @@ var casesHeader = []struct { }, { "normalized keys, non-standard", - []byte("Www-Authenticate: value\r\n" + - "Cseq: value\r\n" + + []byte("www-authenticate: value\r\n" + + "cseq: value\r\n" + + "rtp-info: value\r\n" + "\r\n"), []byte("CSeq: value\r\n" + + "RTP-Info: value\r\n" + "WWW-Authenticate: value\r\n" + "\r\n"), Header{ "CSeq": HeaderValue{"value"}, + "RTP-Info": HeaderValue{"value"}, "WWW-Authenticate": HeaderValue{"value"}, }, },