You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

154 lines
10.0KB

  1. Testing ff_url_decompose:
  2. http://user:pass@ffmpeg:8080/dir/file?query#fragment =>
  3. scheme: http:
  4. authority: //
  5. userinfo: user:pass@
  6. host: ffmpeg
  7. port: :8080
  8. path: /dir/file
  9. query: ?query
  10. fragment: #fragment
  11. http://ffmpeg/dir/file =>
  12. scheme: http:
  13. authority: //
  14. host: ffmpeg
  15. path: /dir/file
  16. file:///dev/null =>
  17. scheme: file:
  18. authority: //
  19. path: /dev/null
  20. file:/dev/null =>
  21. scheme: file:
  22. path: /dev/null
  23. http://[::1]/dev/null =>
  24. scheme: http:
  25. authority: //
  26. host: [::1]
  27. path: /dev/null
  28. http://[::1]:8080/dev/null =>
  29. scheme: http:
  30. authority: //
  31. host: [::1]
  32. port: :8080
  33. path: /dev/null
  34. //ffmpeg/dev/null =>
  35. authority: //
  36. host: ffmpeg
  37. path: /dev/null
  38. test?url=http://server/path =>
  39. path: test
  40. query: ?url=http://server/path
  41. dummy.mp4#t=0:02:00,121.5 =>
  42. path: dummy.mp4
  43. fragment: #t=0:02:00,121.5
  44. Testing ff_make_absolute_url:
  45. (null) baz => baz
  46. /foo/bar baz => /foo/baz
  47. /foo/bar ../baz => /foo/../baz
  48. /foo/bar /baz => /baz
  49. /foo/bar ../../../baz => /foo/../../../baz
  50. http://server/foo/ baz => http://server/foo/baz
  51. http://server/foo/bar baz => http://server/foo/baz
  52. http://server/foo/ ../baz => http://server/baz
  53. http://server/foo/bar/123 ../../baz => http://server/baz
  54. http://server/foo/bar/123 /baz => http://server/baz
  55. http://server/foo/bar/123 https://other/url => https://other/url
  56. http://server/foo/bar?param=value/with/slashes /baz => http://server/baz
  57. http://server/foo/bar?param&otherparam ?someparam => http://server/foo/bar?someparam
  58. http://server/foo/bar //other/url => http://other/url
  59. http://server/foo/bar ../../../../../other/url => http://server/other/url
  60. http://server/foo/bar /../../../../../other/url => http://server/other/url
  61. http://server/foo/bar /test/../../../../../other/url => http://server/other/url
  62. http://server/foo/bar /test/../../test/../../../other/url => http://server/other/url
  63. http://server/foo/bar file:../baz/qux => file:../baz/qux
  64. http://server/foo//bar/ ../../ => http://server/foo/
  65. file:../tmp/foo ../bar/ => file:../tmp/../bar/
  66. file:../tmp/foo file:../bar/ => file:../bar/
  67. http://server/foo/bar ./ => http://server/foo/
  68. http://server/foo/bar .dotfile => http://server/foo/.dotfile
  69. http://server/foo/bar ..doubledotfile => http://server/foo/..doubledotfile
  70. http://server/foo/bar double..dotfile => http://server/foo/double..dotfile
  71. http://server/foo/bar doubledotfile.. => http://server/foo/doubledotfile..
  72. file1 file2 => file2
  73. dir/file1 file2 => dir/file2
  74. dir/file1 ../file2 => dir/../file2
  75. dir\file1 file2 => file2
  76. dir\file1 file2 DOS dir\file2
  77. \\srv\shr\file ..\..\dummy => ..\..\dummy
  78. \\srv\shr\file ..\..\dummy DOS \\srv\shr\..\..\dummy
  79. \\srv\shr\file dummy => dummy
  80. \\srv\shr\file dummy DOS \\srv\shr\dummy
  81. \\srv\shr\file \\srv2\shr2\file2 => \\srv2\shr2\file2
  82. \\srv\shr\file d:/file => d:/file
  83. C:\dir\a ..\file => C:..\file
  84. C:\dir\a ..\file DOS C:\dir\..\file
  85. C:\dir\a \\srv\shr\file => C:\\srv\shr\file
  86. C:\dir\a \\srv\shr\file DOS \\srv\shr\file
  87. C:\dir\a d:\file => d:\file
  88. http://a/b \\srv\shr\file => http://a/\\srv\shr\file
  89. http://a/b //srv/shr/file => http://srv/shr/file
  90. http://a/b d:\file => d:\file
  91. http://a/b C:/file => C:/file
  92. http://a/b/c/d;p?q g:h => g:h
  93. http://a/b/c/d;p?q g => http://a/b/c/g
  94. http://a/b/c/d;p?q ./g => http://a/b/c/g
  95. http://a/b/c/d;p?q g/ => http://a/b/c/g/
  96. http://a/b/c/d;p?q /g => http://a/g
  97. http://a/b/c/d;p?q //g => http://g
  98. http://a/b/c/d;p?q ?y => http://a/b/c/d;p?y
  99. http://a/b/c/d;p?q g?y => http://a/b/c/g?y
  100. http://a/b/c/d;p?q #s => http://a/b/c/d;p?q#s
  101. http://a/b/c/d;p?q g#s => http://a/b/c/g#s
  102. http://a/b/c/d;p?q g?y#s => http://a/b/c/g?y#s
  103. http://a/b/c/d;p?q ;x => http://a/b/c/;x
  104. http://a/b/c/d;p?q g;x => http://a/b/c/g;x
  105. http://a/b/c/d;p?q g;x?y#s => http://a/b/c/g;x?y#s
  106. http://a/b/c/d;p?q => http://a/b/c/d;p?q
  107. http://a/b/c/d;p?q . => http://a/b/c/
  108. http://a/b/c/d;p?q ./ => http://a/b/c/
  109. http://a/b/c/d;p?q .. => http://a/b/
  110. http://a/b/c/d;p?q ../ => http://a/b/
  111. http://a/b/c/d;p?q ../g => http://a/b/g
  112. http://a/b/c/d;p?q ../.. => http://a/
  113. http://a/b/c/d;p?q ../../ => http://a/
  114. http://a/b/c/d;p?q ../../g => http://a/g
  115. http://a/b/c/d;p?q ../../../g => http://a/g
  116. http://a/b/c/d;p?q ../../../../g => http://a/g
  117. http://a/b/c/d;p?q /./g => http://a/g
  118. http://a/b/c/d;p?q /../g => http://a/g
  119. http://a/b/c/d;p?q g. => http://a/b/c/g.
  120. http://a/b/c/d;p?q .g => http://a/b/c/.g
  121. http://a/b/c/d;p?q g.. => http://a/b/c/g..
  122. http://a/b/c/d;p?q ..g => http://a/b/c/..g
  123. http://a/b/c/d;p?q ./../g => http://a/b/g
  124. http://a/b/c/d;p?q ./g/. => http://a/b/c/g/
  125. http://a/b/c/d;p?q g/./h => http://a/b/c/g/h
  126. http://a/b/c/d;p?q g/../h => http://a/b/c/h
  127. http://a/b/c/d;p?q g;x=1/./y => http://a/b/c/g;x=1/y
  128. http://a/b/c/d;p?q g;x=1/../y => http://a/b/c/y
  129. http://a/b/c/d;p?q g?y/./x => http://a/b/c/g?y/./x
  130. http://a/b/c/d;p?q g?y/../x => http://a/b/c/g?y/../x
  131. http://a/b/c/d;p?q g#s/./x => http://a/b/c/g#s/./x
  132. http://a/b/c/d;p?q g#s/../x => http://a/b/c/g#s/../x
  133. Testing av_url_split:
  134. /foo/bar => -1 /foo/bar
  135. http://server/foo/ => http server -1 /foo/
  136. http://example.com/foo/bar => http example.com -1 /foo/bar
  137. http://user:pass@localhost:8080/foo/bar/123 => http user:pass localhost 8080 /foo/bar/123
  138. http://server/foo/bar?param=value/with/slashes => http server -1 /foo/bar?param=value/with/slashes
  139. https://1l-lh.a.net/i/1LIVE_HDS@179577/master.m3u8 => https 1l-lh.a.net -1 /i/1LIVE_HDS@179577/master.m3u8
  140. ftp://u:p%2B%2F2@ftp.pbt.com/ExportHD.mpg => ftp u:p%2B%2F2 ftp.pbt.com -1 /ExportHD.mpg
  141. https://key.dns.com?key_id=2&model_id=12345&&access_key= => https key.dns.com -1 ?key_id=2&model_id=12345&&access_key=
  142. http://example.com#tag => http example.com -1 #tag