You are viewing a plain text version of this content. The canonical link for it is here.
Posted to mod_python-dev@quetz.apache.org by "Graham Dumpleton (JIRA)" <ji...@apache.org> on 2006/03/03 10:53:39 UTC

[jira] Created: (MODPYTHON-141) Allow handlers to trigger proxying of requests.

Allow handlers to trigger proxying of requests.
-----------------------------------------------

         Key: MODPYTHON-141
         URL: http://issues.apache.org/jira/browse/MODPYTHON-141
     Project: mod_python
        Type: Improvement
  Components: core  
    Versions: 3.3    
    Reporter: Graham Dumpleton
 Assigned to: Graham Dumpleton 
     Fix For: 3.3


The req.proxyreq and req.uri attributes are not currently modifiable. If they were modifable, it would be possible for a mod_python handler to trigger proxying of a request to some remote site. For example:

import posixpath

from mod_python import apache

def fixuphandler(req):

  if req.proxyreq:
    return apache.DECLINED

  normalised_uri = posixpath.normpath(req.uri)

  if normalised_uri:
    if normalised_uri != '/' and req.uri[-1] == '/':
      normalised_uri += '/'

  length = len(req.filename)
  length -= len(req.hlist.directory) - 1
  length += len(req.path_info or '')

  baseurl = normalised_uri[:-length]
  path = normalised_uri[len(baseurl):]

  req.proxyreq = apache.PROXYREQ_REVERSE
  req.uri = 'http://www.dscpl.com.au' + path
  req.filename = 'proxy:%s' % req.uri
  req.handler = 'proxy-server'

  return apache.OK

See further discussion on mailing list:

  http://www.modpython.org/pipermail/mod_python/2006-March/020500.html
  http://www.modpython.org/pipermail/mod_python/2006-March/020502.html
  http://www.modpython.org/pipermail/mod_python/2006-March/020503.html
  http://www.modpython.org/pipermail/mod_python/2006-March/020507.html

Patches are include in the last of these emails rather than being attached here.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Resolved: (MODPYTHON-141) Allow handlers to trigger proxying of requests.

Posted by "Graham Dumpleton (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/MODPYTHON-141?page=all ]
     
Graham Dumpleton resolved MODPYTHON-141:
----------------------------------------

    Resolution: Fixed

> Allow handlers to trigger proxying of requests.
> -----------------------------------------------
>
>          Key: MODPYTHON-141
>          URL: http://issues.apache.org/jira/browse/MODPYTHON-141
>      Project: mod_python
>         Type: Improvement
>   Components: core
>     Versions: 3.3
>     Reporter: Graham Dumpleton
>     Assignee: Graham Dumpleton
>      Fix For: 3.3

>
> The req.proxyreq and req.uri attributes are not currently modifiable. If they were modifable, it would be possible for a mod_python handler to trigger proxying of a request to some remote site. For example:
> import posixpath
> from mod_python import apache
> def fixuphandler(req):
>   if req.proxyreq:
>     return apache.DECLINED
>   normalised_uri = posixpath.normpath(req.uri)
>   if normalised_uri:
>     if normalised_uri != '/' and req.uri[-1] == '/':
>       normalised_uri += '/'
>   length = len(req.filename)
>   length -= len(req.hlist.directory) - 1
>   length += len(req.path_info or '')
>   baseurl = normalised_uri[:-length]
>   path = normalised_uri[len(baseurl):]
>   req.proxyreq = apache.PROXYREQ_REVERSE
>   req.uri = 'http://www.dscpl.com.au' + path
>   req.filename = 'proxy:%s' % req.uri
>   req.handler = 'proxy-server'
>   return apache.OK
> See further discussion on mailing list:
>   http://www.modpython.org/pipermail/mod_python/2006-March/020500.html
>   http://www.modpython.org/pipermail/mod_python/2006-March/020502.html
>   http://www.modpython.org/pipermail/mod_python/2006-March/020503.html
>   http://www.modpython.org/pipermail/mod_python/2006-March/020507.html
> Patches are include in the last of these emails rather than being attached here.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Work started: (MODPYTHON-141) Allow handlers to trigger proxying of requests.

Posted by "Graham Dumpleton (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/MODPYTHON-141?page=all ]
     
Work on MODPYTHON-141 started by Graham Dumpleton

> Allow handlers to trigger proxying of requests.
> -----------------------------------------------
>
>          Key: MODPYTHON-141
>          URL: http://issues.apache.org/jira/browse/MODPYTHON-141
>      Project: mod_python
>         Type: Improvement
>   Components: core
>     Versions: 3.3
>     Reporter: Graham Dumpleton
>     Assignee: Graham Dumpleton
>      Fix For: 3.3

>
> The req.proxyreq and req.uri attributes are not currently modifiable. If they were modifable, it would be possible for a mod_python handler to trigger proxying of a request to some remote site. For example:
> import posixpath
> from mod_python import apache
> def fixuphandler(req):
>   if req.proxyreq:
>     return apache.DECLINED
>   normalised_uri = posixpath.normpath(req.uri)
>   if normalised_uri:
>     if normalised_uri != '/' and req.uri[-1] == '/':
>       normalised_uri += '/'
>   length = len(req.filename)
>   length -= len(req.hlist.directory) - 1
>   length += len(req.path_info or '')
>   baseurl = normalised_uri[:-length]
>   path = normalised_uri[len(baseurl):]
>   req.proxyreq = apache.PROXYREQ_REVERSE
>   req.uri = 'http://www.dscpl.com.au' + path
>   req.filename = 'proxy:%s' % req.uri
>   req.handler = 'proxy-server'
>   return apache.OK
> See further discussion on mailing list:
>   http://www.modpython.org/pipermail/mod_python/2006-March/020500.html
>   http://www.modpython.org/pipermail/mod_python/2006-March/020502.html
>   http://www.modpython.org/pipermail/mod_python/2006-March/020503.html
>   http://www.modpython.org/pipermail/mod_python/2006-March/020507.html
> Patches are include in the last of these emails rather than being attached here.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Closed: (MODPYTHON-141) Allow handlers to trigger proxying of requests.

Posted by "Graham Dumpleton (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/MODPYTHON-141?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Graham Dumpleton closed MODPYTHON-141.
--------------------------------------


> Allow handlers to trigger proxying of requests.
> -----------------------------------------------
>
>                 Key: MODPYTHON-141
>                 URL: https://issues.apache.org/jira/browse/MODPYTHON-141
>             Project: mod_python
>          Issue Type: Improvement
>          Components: core
>    Affects Versions: 3.3
>            Reporter: Graham Dumpleton
>         Assigned To: Graham Dumpleton
>             Fix For: 3.3
>
>
> The req.proxyreq and req.uri attributes are not currently modifiable. If they were modifable, it would be possible for a mod_python handler to trigger proxying of a request to some remote site. For example:
> import posixpath
> from mod_python import apache
> def fixuphandler(req):
>   if req.proxyreq:
>     return apache.DECLINED
>   normalised_uri = posixpath.normpath(req.uri)
>   if normalised_uri:
>     if normalised_uri != '/' and req.uri[-1] == '/':
>       normalised_uri += '/'
>   length = len(req.filename)
>   length -= len(req.hlist.directory) - 1
>   length += len(req.path_info or '')
>   baseurl = normalised_uri[:-length]
>   path = normalised_uri[len(baseurl):]
>   req.proxyreq = apache.PROXYREQ_REVERSE
>   req.uri = 'http://www.dscpl.com.au' + path
>   req.filename = 'proxy:%s' % req.uri
>   req.handler = 'proxy-server'
>   return apache.OK
> See further discussion on mailing list:
>   http://www.modpython.org/pipermail/mod_python/2006-March/020500.html
>   http://www.modpython.org/pipermail/mod_python/2006-March/020502.html
>   http://www.modpython.org/pipermail/mod_python/2006-March/020503.html
>   http://www.modpython.org/pipermail/mod_python/2006-March/020507.html
> Patches are include in the last of these emails rather than being attached here.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.