Jordan Szubert added the comment:
#minimal server:
#!/c/Python33/python.exe
from http.server import HTTPServer as S, BaseHTTPRequestHandler as H
class HNDL(H):
def log_request(req,code):
print('header is',req.headers.get('X-Forwarder-For
Jordan Szubert added the comment:
what _lowerHTTP does is try read request header 'X-Forwarded-For', but instance
of request handler have attribute headers only if thing that connected to port
where server listens happened to send valid enough http request
my problem is, document
New submission from Jordan Szubert:
it seems that problem is someone connecting to port 8080 with non-http client,
could not find warning in documentation
---fragment of `less access.log`
81.172.30.254 - - [16/Jun/2013 11:36:58] "^SBitTorrent protocol^@^@^@^@^@^X
Jordan Szubert added the comment:
could not reproduce:
Python 2.6.5 (r265:79096, Mar 19 2010, 21:48:26) [MSC v.1500 32 bit (Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from cStringIO import