Re: Extra / normalization

2008-04-30 Thread Yannick Gingras

Ian Bicking [EMAIL PROTECTED] writes:

 All you can do is include that value as parameter instead, or use  
 WSGI 2 (which of course doesn't exist yet, but somewhere we've penned  
 this 'feature' to be removed in version 2 of the spec).

 It's mentioned as an issue that WSGI 2 could address, but there hasn't 
 been any proposed solution.

For this particular problem, I can work around the slashes collapsing
with a regexp but it would indeed be nice to have a general workaround
in WSGI 2.  Where is it discussed?

-- 
Yannick Gingras

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



Extra / normalization

2008-04-29 Thread Yannick Gingras


Hello Pyloneers, 
  I try to implement a gdata like category search in my app but I have a
hard time embedding an url inside the url and getting it back
unmangled.

Here is how I want to express search for an item that is also a bar
with type 42 but not a foo number 1:

  http://xmpl.com/items/-/{http://xmpl.com/bar}42/-{http://xmpl.com/foo}/1

In other words, I map Atom categories to 
  
  {scheme}term

This is all mostly working except that some part of Pylons converts
all occurences of // to /.  This is probably not routes since I do
get the extra slashes when I call match() directly:

  In [5]: import routes
  In [6]: m = routes.Mapper()
  In [7]: m.connect(/foo/*url, controller=bar, action=asd)
  In [8]: m.match(/foo/qwe///qwe/qux1)
  Out[8]: {'action': u'asd', 'controller': u'bar', 
  'url': u'qwe///qwe/qux1'}

Passing the slashes as %2f do not help: it seems that the stripping
occurs after the URL decoding.

Does anyone know where this stripping occurs and if it's possible to
selectively disable it?

-- 
Yannick Gingras

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



Re: Extra / normalization

2008-04-29 Thread Philip Jenvey


On Apr 29, 2008, at 12:29 PM, Yannick Gingras wrote:


 Passing the slashes as %2f do not help: it seems that the stripping
 occurs after the URL decoding.

 Does anyone know where this stripping occurs and if it's possible to
 selectively disable it?

Unfortunately you can't disable it, WSGI servers must decode the  
URL's path portion before passing it to WSGI apps. Either an RFC or  
the CGI spec (which WSGI 1 stays compatible with) mandates this, I  
can't recall which -- Ben Bangert or Ian Bicking might remember.

All you can do is include that value as parameter instead, or use  
WSGI 2 (which of course doesn't exist yet, but somewhere we've penned  
this 'feature' to be removed in version 2 of the spec).

--
Philip Jenvey



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



Re: Extra / normalization

2008-04-29 Thread Ian Bicking

Philip Jenvey wrote:
 Passing the slashes as %2f do not help: it seems that the stripping
 occurs after the URL decoding.

 Does anyone know where this stripping occurs and if it's possible to
 selectively disable it?
 
 Unfortunately you can't disable it, WSGI servers must decode the  
 URL's path portion before passing it to WSGI apps. Either an RFC or  
 the CGI spec (which WSGI 1 stays compatible with) mandates this, I  
 can't recall which -- Ben Bangert or Ian Bicking might remember.

It's in the CGI spec -- SCRIPT_NAME and PATH_INFO are url-decoded, so 
you can't distinguish between %2f and /.

 All you can do is include that value as parameter instead, or use  
 WSGI 2 (which of course doesn't exist yet, but somewhere we've penned  
 this 'feature' to be removed in version 2 of the spec).

It's mentioned as an issue that WSGI 2 could address, but there hasn't 
been any proposed solution.

-- 
Ian Bicking : [EMAIL PROTECTED] : http://blog.ianbicking.org

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---