[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Global-commit] global THANKS htags/global.cgi.tmpl.in
From: |
Shigio YAMAGUCHI |
Subject: |
[Global-commit] global THANKS htags/global.cgi.tmpl.in |
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 : global.cgi.tmpl.in
Log message:
Modification to support Python's built-in webserver.
Submitted by Alain Kalker.
It is possible (and very convenient :-) ) to serve the website
generated
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
or
$ (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
only
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.
The
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.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/global/THANKS?cvsroot=global&r1=1.105&r2=1.106
http://cvs.savannah.gnu.org/viewcvs/global/htags/global.cgi.tmpl.in?cvsroot=global&r1=1.31&r2=1.32
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Global-commit] global THANKS htags/global.cgi.tmpl.in,
Shigio YAMAGUCHI <=