Patch for nginx handling of X-Accel-Redirect URLs

Maxim Dounin mdounin at mdounin.ru
Thu Feb 2 16:43:23 UTC 2012


Hello!

On Thu, Feb 02, 2012 at 03:58:42PM +0400, vitalif at yourcmc.ru wrote:

> >No.  The NGX_UNESCAPE_URI won't be sufficient, and it's in fact
> >does the wrong thing: it will stop unescaping on first unescaped
> >'?', thus preventing files with two question marks from working.
> 
> ...And why is it wrong???
> As far as I know, the first UNESCAPED '?' means the beginning of
> query string.
> If you want to pass a link to file with two '??' in the name, just
> escape them and that's it.
> (Tested the last patch which I've sent, and it allows access to such
> files)

The "unescaped '?'" in my quote above should be read as "a 
question mark which was obtained via removing %xx escaping from a 
URI".  That is, on "%3D" it will unescape it and stop.

In the patch you've sent you've removed relevant code from 
ngx_unescape_uri(), and that's why it works for you.  I'll review 
the patch as time permits.

Maxim Dounin



More information about the nginx-devel mailing list