From b87f98b78415f776007a79d0998aa15585c6a843 Mon Sep 17 00:00:00 2001 From: Ken Zangelin Date: Thu, 24 Nov 2016 10:31:39 +0100 Subject: [PATCH 1/2] Hotfix about being less strict on Accept header --- src/lib/rest/rest.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/lib/rest/rest.cpp b/src/lib/rest/rest.cpp index e306400cc4..2ab8f59cec 100644 --- a/src/lib/rest/rest.cpp +++ b/src/lib/rest/rest.cpp @@ -463,6 +463,15 @@ static void acceptParse(ConnectionInfo* ciP, const char* value) ++cP; } + // + // HOTFIX for release 1.4.0 + // If that comma is the LAST char in the string - ACCEPT + // + if (*cP == 0) + { + return; + } + acceptItemParse(ciP, itemStart); itemStart = cP; } From 6193b7eac6967939cfa372f2f89ee81835426afc Mon Sep 17 00:00:00 2001 From: Ken Zangelin Date: Thu, 24 Nov 2016 10:40:38 +0100 Subject: [PATCH 2/2] Log Warning on accept headers ending in comma --- src/lib/rest/rest.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib/rest/rest.cpp b/src/lib/rest/rest.cpp index 2ab8f59cec..27bbdc9020 100644 --- a/src/lib/rest/rest.cpp +++ b/src/lib/rest/rest.cpp @@ -469,6 +469,7 @@ static void acceptParse(ConnectionInfo* ciP, const char* value) // if (*cP == 0) { + LM_W(("Invalid Accept Header: ending in comma")); return; }