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
sayer/1.4-spce2.6
Alena Zhuchek 14 years ago committed by Stefan Sayer
parent c314864703
commit dd71a7f44f

@ -810,6 +810,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]) {

@ -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" );

Loading…
Cancel
Save