|
Server : Apache/2.2.2 (Fedora) System : Linux App1.pathumtani.go.th 2.6.20-1.2320.fc5smp #1 SMP Tue Jun 12 19:40:16 EDT 2007 i686 User : apache ( 48) PHP Version : 5.2.9 Disable Function : NONE Directory : /proc/self/root/proc/self/root/usr/lib/python2.4/ |
Upload File : |
mò
Ï=Ec @ sª d Z d Z d g Z d k Z d k Z d k Z d k Z d k Z d k Z d e i f d „ ƒ YZ
e a d „ Z
d „ Z e
e i d „ Z e d j o e ƒ n d S( sr CGI-savvy HTTP Server.
This module builds on SimpleHTTPServer by implementing GET and POST
requests to cgi-bin scripts.
If the os.fork() function is not present (e.g. on Windows),
os.popen2() is used as a fallback, with slightly altered semantics; if
that function is not present either (e.g. on Macintosh), only Python
scripts are supported, and they are executed by the current process.
In all cases, the implementation is intentionally naive -- all
requests are executed sychronously.
SECURITY WARNING: DON'T USE THIS CODE UNLESS YOU ARE INSIDE A FIREWALL
-- it may execute arbitrary Python code or external programs.
s 0.4t CGIHTTPRequestHandlerNc B sƒ t Z d Z e e d ƒ Z e e d ƒ Z e e d ƒ Z d Z d „ Z d „ Z
d „ Z d d g Z d
„ Z
d „ Z d „ Z RS(
s Complete HTTP server with GET, HEAD and POST commands.
GET and HEAD also support running CGI scripts.
The POST command is *only* implemented for CGI scripts.
t forkt popen2t popen3i c C s/ | i ƒ o | i ƒ n | i d d ƒ d S( sR Serve a POST request.
This is only implemented for CGI scripts.
iõ s Can only POST to CGI scriptsN( t selft is_cgit run_cgit
send_error( R ( ( t# /usr/lib/python2.4/CGIHTTPServer.pyt do_POST3 s
c C s/ | i ƒ o | i ƒ Sn t i i | ƒ Sd S( s- Version of send_head that support CGI scriptsN( R R R t SimpleHTTPServert SimpleHTTPRequestHandlert send_head( R ( ( R R ? s
c C s~ | i } xn | i D]c } t | ƒ } | | | j o@ | | p | | d j o# | | | | d f | _ t Sq q Wt S( s± Test whether self.path corresponds to a CGI script.
Return a tuple (dir, rest) if self.path requires running a
CGI script, None if not. Note that rest begins with a
slash if it is not empty.
The default implementation tests whether the path
begins with one of the strings in the list
self.cgi_directories (and the next character is a '/'
or the end of the string).
t /i N( R t patht cgi_directoriest xt lent it cgi_infot Truet False( R R R R ( ( R R F s
.s /cgi-bins /htbinc C s
t | ƒ S( s1 Test whether argument path is an executable file.N( t
executableR ( R R ( ( R t
is_executable_ s c C s( t i i | ƒ \ } } | i ƒ d j S( s. Test whether argument path is a Python script.s .pys .pywN( s .pys .pyw( t osR t splitextt headt tailt lower( R R R R ( ( R t is_pythonc s c * C sÓ | i \ }( }
|
i d ƒ }"