Revision 200e38ac lib/http/server.py
b/lib/http/server.py | ||
---|---|---|
268 | 268 |
try: |
269 | 269 |
try: |
270 | 270 |
request_msg_reader = self._ReadRequest() |
271 |
|
|
272 |
# RFC2616, 14.23: All Internet-based HTTP/1.1 servers MUST respond |
|
273 |
# with a 400 (Bad Request) status code to any HTTP/1.1 request |
|
274 |
# message which lacks a Host header field. |
|
275 |
if (self.request_msg.start_line.version == http.HTTP_1_1 and |
|
276 |
http.HTTP_HOST not in self.request_msg.headers): |
|
277 |
raise http.HttpBadRequest(message="Missing Host header") |
|
278 |
|
|
271 | 279 |
self._HandleRequest() |
272 | 280 |
|
273 | 281 |
# Only wait for client to close if we didn't have any exception. |
Also available in: Unified diff