Process a request from an HTML browser. The URL received is in self.path. Get an HTML page from self.urlhandler and send it.
(self)
| 2394 | class DocHandler(http.server.BaseHTTPRequestHandler): |
| 2395 | |
| 2396 | def do_GET(self): |
| 2397 | """Process a request from an HTML browser. |
| 2398 | |
| 2399 | The URL received is in self.path. |
| 2400 | Get an HTML page from self.urlhandler and send it. |
| 2401 | """ |
| 2402 | if self.path.endswith('.css'): |
| 2403 | content_type = 'text/css' |
| 2404 | else: |
| 2405 | content_type = 'text/html' |
| 2406 | self.send_response(200) |
| 2407 | self.send_header('Content-Type', '%s; charset=UTF-8' % content_type) |
| 2408 | self.end_headers() |
| 2409 | self.wfile.write(self.urlhandler( |
| 2410 | self.path, content_type).encode('utf-8')) |
| 2411 | |
| 2412 | def log_message(self, *args): |
| 2413 | # Don't log messages. |
nothing calls this directly
no test coverage detected