URL Decoding problems

Maxim Dounin mdounin at mdounin.ru
Tue Jan 17 15:50:38 UTC 2012


Hello!

On Tue, Jan 17, 2012 at 01:49:13PM +0000, Alex Chamberlain wrote:

> Hi all,
> 
> I've got a content handler that accesses request->uri. However, if the
> uri includes encoded forward slashes, these are collapsed into a
> single forward slash. Is this correct behaviour? I can understand
> collapsing multiple, unencoded slashes, but not encoded ones.
> 
> (Very bad, first version) code is at
> https://github.com/alexchamberlain/nginx-qrcode.
> 
> An example would be
> http://localhost/qr/http%3A%2F%2F%2Fwww.alexchamberlain.co.uk
> 
> Any help greatly appreciated.

Right now nginx decodes URI to be able to work with it, in 
particular - map it to a file system.  Decoding of the "/" is most 
questionable part of the process, but it's how it works now.  If 
you need original uri as provided by client - the one is available 
via r->unparsed_uri.

Maxim Dounin



More information about the nginx-devel mailing list