Welcome! Log In Create A New Profile

Advanced

[Bug] X-Accel-Redirect

September 08, 2010 06:56AM
Hi everyone,

I got a server which serves Data to a client ( in my case MP3s ). The MP3s are saved in a storage directory in the form Artist - Title.mp3

I'm using X-Accel-Redirect to serve the files from the storage dir to the user. This workes fine for most cases but fails for special chars like the question mark. I already tried encoding it - but the char always gets stripped like in Query strings. But since it's not an url I'm providing no stripping should take place. Here are my results:


[b]Example Filename is: /ext/53665/Katy Perry - Who Am I Living For?.mp3[/b]

[b]Plain:[/b]
open() "/ext/53665/Katy Perry - Who Am I Living For" failed (2: No such file or directory)

[b]urlencoded:[/b]
open() "/usr/local/nginx/html%2Fdl%2F53665%2FKaty+Perry+-+Who+Am+I+Living+For%253F.mp3" failed (2: No such file or directory)

[b]Rawurlencoded:[/b]
open() "/usr/local/nginx/html%2Fdl%2F53665%2FKaty%20Perry%20-%20Who%20Am%20I%20Living%20For%3F.mp3" failed (2: No such file or directory)

[b]Replaced ? with \?[/b]
open() "/ext/53665/Katy Perry - Who Am I Living For\" failed (2: No such file or directory)

[b]Escaped ? to %3F[/b]
open() "/ext/53665/Katy Perry - Who Am I Living For%3F.mp3" failed (2: No such file or directory)

It seems like X-Accel-Redirect treats the path as url instead of a realpath - or even doesn't apply any decoding on the subrequest.

best regards,

Volker
Subject Author Posted

[Bug] X-Accel-Redirect

rovervr September 08, 2010 06:56AM

Re: [Bug] X-Accel-Redirect

Maxim Dounin September 08, 2010 11:16AM

X-Accel-Redirect Decode Patch

rovervr September 09, 2010 08:03AM

Re: X-Accel-Redirect Decode Patch

Dennis J. September 09, 2010 08:40AM

Re: X-Accel-Redirect Decode Patch

Maxim Dounin September 09, 2010 01:28PM

Re: [Bug] X-Accel-Redirect

rovervr September 09, 2010 08:50AM

Re: [Bug] X-Accel-Redirect

rovervr September 09, 2010 02:19PM

Re: [Bug] X-Accel-Redirect

rovervr September 09, 2010 02:29PM

Re: [Bug] X-Accel-Redirect

rovervr October 03, 2010 10:11AM

Re: [Bug] X-Accel-Redirect

Maxim Dounin September 09, 2010 02:42PM

Re: [Bug] X-Accel-Redirect

Maxim Dounin September 09, 2010 02:50PM

Re: [Bug] X-Accel-Redirect

Maxim Dounin October 16, 2010 01:26PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 83
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready