nginx-vod-module icon indicating copy to clipboard operation
nginx-vod-module copied to clipboard

URI needs to be escaped

Open nallown opened this issue 2 years ago • 6 comments

I'm currently using kaltura-nginx in remote mode. Whenever a DASH manifest request gets made to the kaltura-nginx server, it seems to parse the filename fine and extract the filename from the manifest URL.

For example:

http://x.com/edash/directory/subdirectory/Dot%20Hack%20G.U.%20Trilogy%20%5B1080p%20x264%5D%5BF-R%5D%5B5CBCD6FB%5D.mp4,.urlset/manifest.mpd

gets converted to the following fine:

/directory/subdirectory/Dot Hack G.U. Trilogy [1080p x264][F-R][5CBCD6FB].mp4

But when I check the origin server that it proxies to, it seems to fail to load the video file from there, since there is whitespace and various other unicode characters that need to be escaped there.

nallown avatar Oct 18 '22 13:10 nallown

Why would you want to have spaces in your file names? @nallown

mlevkov avatar Nov 02 '22 21:11 mlevkov

I have the same issue. I don't "want" files with spaces in their names but they exist and it would not be practical to get them changed and ban spaces. Remote mode, upstream host is nginx.

Filenames with spaces seemingly randomly work or do not work.

*50 ngx_child_request_wev_handler: upstream returned a bad status 400 while sending to client, client: x.x.x.x, server: vod, request: "GET /hls/test/H%20H.mp4/index.m3u8?_=1668520878252 HTTP/1.1"

Filenames as simple as "A A.mp4" do not work.

isilive avatar Nov 15 '22 14:11 isilive

You would need to have a custom regex and rewrite to likely handle this case.

mlevkov avatar Nov 16 '22 01:11 mlevkov

@mlevkov do you have a example of how the regex can look like and how it can be implemented?

nallown avatar Nov 30 '22 13:11 nallown

I have the same issue. I don't "want" files with spaces in their names but they exist and it would not be practical to get them changed and ban spaces. Remote mode, upstream host is nginx.

Filenames with spaces seemingly randomly work or do not work.

*50 ngx_child_request_wev_handler: upstream returned a bad status 400 while sending to client, client: x.x.x.x, server: vod, request: "GET /hls/test/H%20H.mp4/index.m3u8?_=1668520878252 HTTP/1.1"

Filenames as simple as "A A.mp4" do not work.

I also found same issue but "A A.mp4" works fine actually it doesn't work when filename has " H" subsctring (in encoded form its "%20H"). Probably nginx internally somehow triggered by this substring but I found nothing about it in nginx VOD module documentation. We have existing files with spaces which came from different platform which and which we have to support. So getting rid of spaces is not a solution for us. @mlevkov what makes VOD module behave different on " H" substring? is it a bug?

dima-ravnur avatar Jan 19 '24 15:01 dima-ravnur

Sure, I can help you with that. Let put some samples together.

mlevkov avatar Apr 16 '24 19:04 mlevkov