Edit File by line
/home/barbar84/www/wp-conte.../plugins/sujqvwi/AnonR/smanonr..../usr/lib64/python2....
File: BaseHTTPServer.py
"""Return the client address formatted for logging.
[500] Fix | Delete
[501] Fix | Delete
This version looks up the full hostname using gethostbyaddr(),
[502] Fix | Delete
and tries to find a name that contains at least one dot.
[503] Fix | Delete
[504] Fix | Delete
"""
[505] Fix | Delete
[506] Fix | Delete
host, port = self.client_address[:2]
[507] Fix | Delete
return socket.getfqdn(host)
[508] Fix | Delete
[509] Fix | Delete
# Essentially static class variables
[510] Fix | Delete
[511] Fix | Delete
# The version of the HTTP protocol we support.
[512] Fix | Delete
# Set this to HTTP/1.1 to enable automatic keepalive
[513] Fix | Delete
protocol_version = "HTTP/1.0"
[514] Fix | Delete
[515] Fix | Delete
# The Message-like class used to parse headers
[516] Fix | Delete
MessageClass = mimetools.Message
[517] Fix | Delete
[518] Fix | Delete
# Table mapping response codes to messages; entries have the
[519] Fix | Delete
# form {code: (shortmessage, longmessage)}.
[520] Fix | Delete
# See RFC 2616.
[521] Fix | Delete
responses = {
[522] Fix | Delete
100: ('Continue', 'Request received, please continue'),
[523] Fix | Delete
101: ('Switching Protocols',
[524] Fix | Delete
'Switching to new protocol; obey Upgrade header'),
[525] Fix | Delete
[526] Fix | Delete
200: ('OK', 'Request fulfilled, document follows'),
[527] Fix | Delete
201: ('Created', 'Document created, URL follows'),
[528] Fix | Delete
202: ('Accepted',
[529] Fix | Delete
'Request accepted, processing continues off-line'),
[530] Fix | Delete
203: ('Non-Authoritative Information', 'Request fulfilled from cache'),
[531] Fix | Delete
204: ('No Content', 'Request fulfilled, nothing follows'),
[532] Fix | Delete
205: ('Reset Content', 'Clear input form for further input.'),
[533] Fix | Delete
206: ('Partial Content', 'Partial content follows.'),
[534] Fix | Delete
[535] Fix | Delete
300: ('Multiple Choices',
[536] Fix | Delete
'Object has several resources -- see URI list'),
[537] Fix | Delete
301: ('Moved Permanently', 'Object moved permanently -- see URI list'),
[538] Fix | Delete
302: ('Found', 'Object moved temporarily -- see URI list'),
[539] Fix | Delete
303: ('See Other', 'Object moved -- see Method and URL list'),
[540] Fix | Delete
304: ('Not Modified',
[541] Fix | Delete
'Document has not changed since given time'),
[542] Fix | Delete
305: ('Use Proxy',
[543] Fix | Delete
'You must use proxy specified in Location to access this '
[544] Fix | Delete
'resource.'),
[545] Fix | Delete
307: ('Temporary Redirect',
[546] Fix | Delete
'Object moved temporarily -- see URI list'),
[547] Fix | Delete
[548] Fix | Delete
400: ('Bad Request',
[549] Fix | Delete
'Bad request syntax or unsupported method'),
[550] Fix | Delete
401: ('Unauthorized',
[551] Fix | Delete
'No permission -- see authorization schemes'),
[552] Fix | Delete
402: ('Payment Required',
[553] Fix | Delete
'No payment -- see charging schemes'),
[554] Fix | Delete
403: ('Forbidden',
[555] Fix | Delete
'Request forbidden -- authorization will not help'),
[556] Fix | Delete
404: ('Not Found', 'Nothing matches the given URI'),
[557] Fix | Delete
405: ('Method Not Allowed',
[558] Fix | Delete
'Specified method is invalid for this resource.'),
[559] Fix | Delete
406: ('Not Acceptable', 'URI not available in preferred format.'),
[560] Fix | Delete
407: ('Proxy Authentication Required', 'You must authenticate with '
[561] Fix | Delete
'this proxy before proceeding.'),
[562] Fix | Delete
408: ('Request Timeout', 'Request timed out; try again later.'),
[563] Fix | Delete
409: ('Conflict', 'Request conflict.'),
[564] Fix | Delete
410: ('Gone',
[565] Fix | Delete
'URI no longer exists and has been permanently removed.'),
[566] Fix | Delete
411: ('Length Required', 'Client must specify Content-Length.'),
[567] Fix | Delete
412: ('Precondition Failed', 'Precondition in headers is false.'),
[568] Fix | Delete
413: ('Request Entity Too Large', 'Entity is too large.'),
[569] Fix | Delete
414: ('Request-URI Too Long', 'URI is too long.'),
[570] Fix | Delete
415: ('Unsupported Media Type', 'Entity body in unsupported format.'),
[571] Fix | Delete
416: ('Requested Range Not Satisfiable',
[572] Fix | Delete
'Cannot satisfy request range.'),
[573] Fix | Delete
417: ('Expectation Failed',
[574] Fix | Delete
'Expect condition could not be satisfied.'),
[575] Fix | Delete
[576] Fix | Delete
500: ('Internal Server Error', 'Server got itself in trouble'),
[577] Fix | Delete
501: ('Not Implemented',
[578] Fix | Delete
'Server does not support this operation'),
[579] Fix | Delete
502: ('Bad Gateway', 'Invalid responses from another server/proxy.'),
[580] Fix | Delete
503: ('Service Unavailable',
[581] Fix | Delete
'The server cannot process the request due to a high load'),
[582] Fix | Delete
504: ('Gateway Timeout',
[583] Fix | Delete
'The gateway server did not receive a timely response'),
[584] Fix | Delete
505: ('HTTP Version Not Supported', 'Cannot fulfill request.'),
[585] Fix | Delete
}
[586] Fix | Delete
[587] Fix | Delete
[588] Fix | Delete
def test(HandlerClass = BaseHTTPRequestHandler,
[589] Fix | Delete
ServerClass = HTTPServer, protocol="HTTP/1.0"):
[590] Fix | Delete
"""Test the HTTP request handler class.
[591] Fix | Delete
[592] Fix | Delete
This runs an HTTP server on port 8000 (or the first command line
[593] Fix | Delete
argument).
[594] Fix | Delete
[595] Fix | Delete
"""
[596] Fix | Delete
[597] Fix | Delete
if sys.argv[1:]:
[598] Fix | Delete
port = int(sys.argv[1])
[599] Fix | Delete
else:
[600] Fix | Delete
port = 8000
[601] Fix | Delete
server_address = ('', port)
[602] Fix | Delete
[603] Fix | Delete
HandlerClass.protocol_version = protocol
[604] Fix | Delete
httpd = ServerClass(server_address, HandlerClass)
[605] Fix | Delete
[606] Fix | Delete
sa = httpd.socket.getsockname()
[607] Fix | Delete
print "Serving HTTP on", sa[0], "port", sa[1], "..."
[608] Fix | Delete
httpd.serve_forever()
[609] Fix | Delete
[610] Fix | Delete
[611] Fix | Delete
if __name__ == '__main__':
[612] Fix | Delete
test()
[613] Fix | Delete
[614] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function