[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Global-commit] global THANKS htags/

From: Shigio YAMAGUCHI
Subject: [Global-commit] global THANKS htags/
Date: Fri, 08 Feb 2013 04:50:49 +0000

CVSROOT:        /sources/global
Module name:    global
Changes by:     Shigio YAMAGUCHI <shigio>       13/02/08 04:50:48

Modified files:
        .              : THANKS 
        htags          : 

Log message:
        Modification to support Python's built-in webserver.
        Submitted by Alain Kalker.
        It is possible (and very convenient :-) ) to serve the website 
        by `htags --suggest2` using nothing more than:
        $ pwd > GTAGSROOT # to enable global.cgi to find the tags files
        $ (cd HTML; python -m http.server --cgi) # Python 3.x
        $ (cd HTML; python -m CGIHTTPServer) # Python 2.x
        and browsing to: http://localhost:8000/index.html
        (The .../index.html is required, as Python doesn't map / path to 
        /index.html automatically.)
        However, Python's built-in webserver (and possibly some others) doesn't 
        support redirects issued from CGI scripts, so when a search returns 
        1 result, users will see a blank page instead of the source page with 
        the result.
        This patch addresses this problem by sending an HTML snippet in the 
        response body (yes, the standards allow for this!) to make the browser 
        perform the redirect on its own, using the "META Refresh" method.
        The extra data sent shouldn't have any effect on servers which do 
        support CGI redirects.
        I've left room for a secondary fallback by including a link in the 
        <body></body> block, in case the refresh method doesn't work either. 
        refresh method is deprecated, but I hope that by the time it isn't 
        supported anymore, the CGI redirection problem will be fixed in the 
        webservers anyway.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]