Module: sems
Branch: master
Commit: 5c22cbebb32dcbd4c590a91c37d8950993cbda39
URL:    
http://git.sip-router.org/cgi-bin/gitweb.cgi/sems/?a=commit;h=5c22cbebb32dcbd4c590a91c37d8950993cbda39

Author: Alena Zhuchek <[email protected]>
Committer: Stefan Sayer <[email protected]>
Date:   Wed Jun  6 14:56:04 2012 +0200

b/f: fix incorrect parsing of keys with semicolon at the beginning in 
get_header_keyvalue

e.g. P-App-Param: ;u=user;d=domain would not be parsed correctly.

internal bug #74

fixes commit 8193c35a

---

 core/AmUtils.cpp            |    1 +
 core/tests/test_headers.cpp |    1 +
 2 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/core/AmUtils.cpp b/core/AmUtils.cpp
index 208c6e5..55b9e89 100644
--- a/core/AmUtils.cpp
+++ b/core/AmUtils.cpp
@@ -818,6 +818,7 @@ string get_header_keyvalue_single(const string& param_hdr, 
const string& name) {
       switch (curr) {
       case ' ': // spaces before the key
       case '\t':
+      case ';': // semicolons before the key
        break;
       default:
        if (curr==name[0]) {
diff --git a/core/tests/test_headers.cpp b/core/tests/test_headers.cpp
index 6ee83d7..51aab81 100644
--- a/core/tests/test_headers.cpp
+++ b/core/tests/test_headers.cpp
@@ -45,6 +45,7 @@ FCTMF_SUITE_BGN(test_headers) {
 
       fct_chk(get_header_keyvalue(getHeader("P-App-Param: 
product_id=1;productid=1;bla=blub ", "P-App-Param"), "product_id") == "1");
       fct_chk(get_header_keyvalue(getHeader("P-App-Param: 
product_id=11;productid=1;bla=blub ", "P-App-Param"), "product_id") == "11");
+      fct_chk(get_header_keyvalue(getHeader("P-App-Param: ;u=user;d=domain", 
"P-App-Param"), "u") == "user");
 
 
       fct_chk(get_header_keyvalue(getHeader("P-My-Test: mykey=myval; 
myotherfunkykey=myval;andsomemore", "P-My-Test", true), "mykey") == "myval" );

_______________________________________________
Semsdev mailing list
[email protected]
http://lists.iptel.org/mailman/listinfo/semsdev

Reply via email to