#15718: Django unquotes urls and not able to distinguish %2F and /
-------------------------------------+-------------------------------------
               Reporter:  fed239     |        Owner:  nobody
                 Status:  new        |    Milestone:
              Component:  Core       |      Version:  1.2
  (Other)                            |     Keywords:  urls, url resolver,
             Resolution:             |  unquote, %2F
           Triage Stage:             |    Has patch:  0
  Unreviewed                         |  Needs tests:  0
    Needs documentation:  0          |
Patch needs improvement:  0          |
-------------------------------------+-------------------------------------
Changes (by fed239):

 * needs_better_patch:   => 0
 * needs_tests:   => 0
 * needs_docs:   => 0


Comment:

 After investigation I've found that the 2nd issue (404 error directly from
 apache) is not related to django and can be avoided by adding
 "AllowEncodedSlashes On" into apache config. Unfortunately apache replaces
 %2f with / itself, so the behavior is exactly the same as in simple http
 server provided by django. In Apache 2.2.18 (which is not released yet, i
 guess), AllowEncodedSlashes allows value NoDecode. With the value
 NoDecode, such URLs are accepted, but encoded slashes are not decoded but
 left in their encoded state. Meanwhile I'm using the workaround
 {{{
         request_uri = force_unicode(environ.get('REQUEST_URI', u'/'))
         if u'?' in request_uri:
             path_info,query = request_uri.split('?',1)
         else:
             path_info,query = request_uri,''
 }}}
 instead of original
 {{{
         path_info = force_unicode(environ.get('PATH_INFO', u'/'))

 }}}
 in core/handlers/wsgi.py

-- 
Ticket URL: <http://code.djangoproject.com/ticket/15718#comment:1>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to