william-os4y / fapws3

Fast Asynchronous Python Web Server (based on libev)
GNU General Public License v2.0
341 stars 38 forks source link

SERVER_PORT should be string #9

Closed waltercruz closed 14 years ago

waltercruz commented 14 years ago

After a whole day tring to run moinmoin on fapws3, I fall into a a simple subject.

Moinmoin uses the environ['SERVER_PORT'] to create the cookie_name, if you don't provide one

    url_components = [
        # cookies do not store the port, thus we add it to the cookie name:
        request.environ['SERVER_PORT'],
        # we always store path=/ into cookie, thus we add the path to the name:
        ('ROOT' + request.script_root).replace('/', '_'),
    ]
    name = '_'.join(url_components)

But the SERVER_PORT on fapws3 comes as a integer, and this will cause problem. This even breaks the WSGI standart "it is a violation of this specification for a CGI variable's value to be of any type other than str."

A very simple to fix bug :)

william-os4y commented 14 years ago

If you could share your python script serving moinmoin, I could test it ;-).

Anyhow with the fixes of this April, 28th this should work now; at least based on your feedback.

W.

waltercruz commented 14 years ago

the conf to run moin is on http://gist.github.com/382655 (sorry for the noise in the file, I still need to clean it!). You can use it as a base to run moin.

Another minor issue, when using a wikifarm on moin, it uses regexes to find the right wiki... fapws pass the http in uppercase.. I just needed to add another line in my farmconfig.py with uppercase http like:

("walterwiki", r"^HTTP://waltercruz.com/wiki/.*$"),  

Will upgrade my install and test it!

william-os4y commented 14 years ago

The last release fix the http in uppercase problem