|
Server : Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8e-fips-rhel5 DAV/2 PHP/5.2.17 System : Linux localhost 2.6.18-419.el5 #1 SMP Fri Feb 24 22:47:42 UTC 2017 x86_64 User : nobody ( 99) PHP Version : 5.2.17 Disable Function : NONE Directory : /proc/21585/root/usr/lib64/python2.4/ |
Upload File : |
mò
‚=5Dc @ 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
d „ Z 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/lib64/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 s8 t | i ƒ } | d | i j o | | _ t Sn t S( s° Test whether self.path corresponds to a CGI script.
Returns True and updates the cgi_info attribute to the tuple
(dir, rest) if self.path requires running a CGI script.
Returns False otherwise.
The default implementation tests whether the normalized url
path begins with one of the strings in self.cgi_directories
(and the next character is a '/' or the end of the string).
i N( t _url_collapse_path_splitR t patht splitpatht cgi_directoriest cgi_infot Truet False( 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_executableY 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_python] s c * C sÓ | i \ }( }
|
i d ƒ }"