Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
BC
public
belle-sip
Commits
38225cd8
Commit
38225cd8
authored
Nov 27, 2013
by
jehan
Browse files
fix uri param escape list
parent
62ee9e23
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/belle_sip_utils.c
View file @
38225cd8
...
...
@@ -871,6 +871,10 @@ static const char *get_uri_parameter_noescapes() {
token = 1*(alphanum / "-" / "." / "!" / "%" / "*"
/ "_" / "+" / "`" / "'" / "~" )
*/
//param-unreserved =
noescapes_add_list
(
noescapes
,
"[]/:&+$"
);
// token
noescapes_add_alfanums
(
noescapes
);
noescapes_add_list
(
noescapes
,
"-.!%*_+`'~"
);
...
...
tester/belle_sip_uri_tester.c
View file @
38225cd8
...
...
@@ -237,14 +237,14 @@ static void test_escaped_passwd(void) {
static
void
test_escaped_parameter
(
void
)
{
belle_sip_uri_t
*
L_tmp
;
belle_sip_uri_t
*
L_uri
=
belle_sip_uri_parse
(
"sip:toto@titi.com;pa%3Dram=aa%40bb;o%40"
);
belle_sip_uri_t
*
L_uri
=
belle_sip_uri_parse
(
"sip:toto@titi.com;pa%3Dram=aa%40bb
:5060[]
;o%40"
);
char
*
l_raw_uri
=
belle_sip_object_to_string
(
BELLE_SIP_OBJECT
(
L_uri
));
belle_sip_object_unref
(
BELLE_SIP_OBJECT
(
L_uri
));
L_tmp
=
belle_sip_uri_parse
(
l_raw_uri
);
L_uri
=
BELLE_SIP_URI
(
belle_sip_object_clone
(
BELLE_SIP_OBJECT
(
L_tmp
)));
belle_sip_object_unref
(
BELLE_SIP_OBJECT
(
L_tmp
));
belle_sip_free
(
l_raw_uri
);
CU_ASSERT_STRING_EQUAL
(
belle_sip_parameters_get_parameter
(
BELLE_SIP_PARAMETERS
(
L_uri
),
"pa=ram"
),
"aa@bb"
);
CU_ASSERT_STRING_EQUAL
(
belle_sip_parameters_get_parameter
(
BELLE_SIP_PARAMETERS
(
L_uri
),
"pa=ram"
),
"aa@bb
:5060[]
"
);
CU_ASSERT_TRUE
(
belle_sip_parameters_has_parameter
(
BELLE_SIP_PARAMETERS
(
L_uri
),
"o@"
));
CU_ASSERT_STRING_EQUAL
(
belle_sip_uri_get_host
(
L_uri
),
"titi.com"
);
belle_sip_object_unref
(
BELLE_SIP_OBJECT
(
L_uri
));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment