Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
GoogleCodeExporter opened this issue Mar 1, 2016 · 2 comments

Comments

@GoogleCodeExporter
Copy link

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 [email protected] on 13 Feb 2013 at 4:06

@GoogleCodeExporter
Copy link
Author

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 [email protected] on 13 Feb 2013 at 9:26

@GoogleCodeExporter
Copy link
Author

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 [email protected] on 14 Feb 2013 at 8:26

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant