avformat/url: check url root node when rel include double dot and trim double dot

fix ticket: 8625
and add testcase into url for double dot corner case

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
This commit is contained in:
Steven Liu
2020-04-29 12:50:57 +08:00
parent 666dbe7aac
commit 648051f07c
3 changed files with 83 additions and 4 deletions
+5
View File
@@ -56,6 +56,7 @@ int main(void)
test("/foo/bar", "baz");
test("/foo/bar", "../baz");
test("/foo/bar", "/baz");
test("/foo/bar", "../../../baz");
test("http://server/foo/", "baz");
test("http://server/foo/bar", "baz");
test("http://server/foo/", "../baz");
@@ -65,6 +66,10 @@ int main(void)
test("http://server/foo/bar?param=value/with/slashes", "/baz");
test("http://server/foo/bar?param&otherparam", "?someparam");
test("http://server/foo/bar", "//other/url");
test("http://server/foo/bar", "../../../../../other/url");
test("http://server/foo/bar", "/../../../../../other/url");
test("http://server/foo/bar", "/test/../../../../../other/url");
test("http://server/foo/bar", "/test/../../test/../../../other/url");
printf("\nTesting av_url_split:\n");
test2("/foo/bar");