Commit 5028dff1 authored by jehan's avatar jehan

make sure uri without host are valid

parent 50c6caa9
......@@ -309,6 +309,8 @@ catch [ANTLR3_MISMATCHED_TOKEN_EXCEPTION]
hier_part[belle_generic_uri_t* uri] returns [belle_generic_uri_t* ret=NULL]
: (
(SLASH SLASH path_segments[NULL])=>( SLASH SLASH path_segments[uri])
|
(SLASH SLASH)=>( SLASH SLASH authority[uri] (path_segments[uri])?)
|
( path_segments[uri]) )
......
......@@ -94,13 +94,13 @@ static void test_file_path() {
belle_sip_object_unref(source_uri);
}
//this is INVALID
source_uri = belle_generic_uri_parse("file:///./relative-file");
/*this is INVALID*/
source_uri = belle_generic_uri_parse("file://./relative-file");
CU_ASSERT_PTR_NULL(source_uri);
// instead, this should be VALID
/* PATH segment always start by / */
source_uri = belle_generic_uri_parse("./relative-file");
CU_ASSERT_PTR_NOT_NULL(source_uri);
CU_ASSERT_PTR_NULL(source_uri);
if (source_uri!=NULL){
belle_sip_object_unref(source_uri);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment