devashishbcsingh / modwsgi

Automatically exported from code.google.com/p/modwsgi
0 stars 0 forks source link

environ['PATH_INFO'] comes distorted when request URI includes './' #290

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
This bug persists on Apache 2.2/2.4 and mod_wsgi 3.3/3.4

My apache.conf wsgi directive is defined as follow: 
WSGIScriptAlias / "C:/Programs/Apache2.2/conf/bic.wsgi" 

When I accesses the following address: 
http://127.0.0.1/first./second

my wsgi environ values are: 
environ['SCRIPT_NAME']: /first.
environ['PATH_INFO']:   /first/second
environ['REQUEST_URI']: /first./second 

'.' is omitted from the PATH_INFO and for some reason SCRIPT_NAME is not blank.

Bugfix needed :)

Original issue reported on code.google.com by odedgo...@gmail.com on 13 Feb 2013 at 4:06

GoogleCodeExporter commented 8 years ago
Check that you do not have any mod_rewrite rules in your Apache configuration 
as that can stuff things up.

So can check, suggest you supply the mod_wsgi configuration from Apache along 
with any Alias or RewriteRule/RewriteCond directives that are in effect for 
that host.

Original comment by Graham.Dumpleton@gmail.com on 13 Feb 2013 at 9:26

GoogleCodeExporter commented 8 years ago
no RewriteRule/RewriteCond directives, rewrite_module is not even loaded.

httpd.conf
----------
<VirtualHost *:80>
    DocumentRoot  "C:/DocumentRoot"
    TimeOut 30
    #KeepAliveTimeout On
    LimitRequestFieldSize 16380
    <Directory "C:/Programs/Apache/conf">
        AllowOverride None
        Options None
        Require all granted
    </Directory>                                                  
    WSGIScriptAlias / "C:/Programs/Apache/conf/bic.wsgi" 
</VirtualHost>

bic.wsgi
--------
def application(environ, start_response):
    status = '200 OK'
    output = str(environ)
    response_headers = [('Content-type', 'text/plain'),
                        ('Content-Length', str(len(output)))]
    start_response(status, response_headers)
    return [output]

Original comment by odedgo...@gmail.com on 14 Feb 2013 at 8:26