[docs] [issue18229] attribute headers of http.server.BaseHTTPRequestHandler sometimes does not exists

Jordan Szubert report at bugs.python.org
Sun Jun 16 11:59:21 CEST 2013


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^@^Ej
81.172.30.254 - - [16/Jun/2013 11:38:11] "^N<U+008E>^@f¸ãÄòQ;³x<U+0092>b^C^HÄA7
81.172.30.254 - - [16/Jun/2013 11:39:22] "^SBitTorrent protocol^@^@^@^@^@^X^@^Ej
81.172.30.254 - - [16/Jun/2013 11:40:35] "Ã<U+008D>¬0æz<U+0093>zr^D<U+009B>2]WQ



Exception happened during processing of request from ('81.172.30.254', 63650)
Traceback (most recent call last):
  File "c:\Python33\lib\socketserver.py", line 306, in _handle_request_noblock
    self.process_request(request, client_address)
  File "c:\Python33\lib\socketserver.py", line 332, in process_request
    self.finish_request(request, client_address)
  File "c:\Python33\lib\socketserver.py", line 345, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "c:\Python33\lib\socketserver.py", line 666, in __init__
    self.handle()
  File "c:\Python33\lib\http\server.py", line 400, in handle
    self.handle_one_request()
  File "c:\Python33\lib\http\server.py", line 380, in handle_one_request
    if not self.parse_request():
  File "c:\Python33\lib\http\server.py", line 283, in parse_request
    self.send_error(400, "Bad request version (%r)" % version)
  File "c:\Python33\lib\http\server.py", line 428, in send_error
    self.send_response(code, message)
  File "c:\Python33\lib\http\server.py", line 443, in send_response
    self.log_request(code)
  File "c:\Users\joru\Dropbox\programowanie\demoniszcze\server\_lowerHTTP.py", line 30, in log_request
    xff=req.headers.get('X-Forwarded-For')
AttributeError: '_HNDL_3' object has no attribute 'headers'
# _HNLD_3 derives from http.server.BaseHTTPRequestHandler

----------
assignee: docs at python
components: Documentation
messages: 191264
nosy: docs at python, joru
priority: normal
severity: normal
status: open
title: attribute headers of http.server.BaseHTTPRequestHandler sometimes does not exists
type: behavior
versions: Python 3.3

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue18229>
_______________________________________


More information about the docs mailing list