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)
| 2346 | class DocHandler(http.server.BaseHTTPRequestHandler): |
| 2347 | |
| 2348 | def do_GET(self): |
| 2349 | """Process a request from an HTML browser. |
| 2350 | |
| 2351 | The URL received is in self.path. |
| 2352 | Get an HTML page from self.urlhandler and send it. |
| 2353 | """ |
| 2354 | if self.path.endswith('.css'): |
| 2355 | content_type = 'text/css' |
| 2356 | else: |
| 2357 | content_type = 'text/html' |
| 2358 | self.send_response(200) |
| 2359 | self.send_header('Content-Type', '%s; charset=UTF-8' % content_type) |
| 2360 | self.end_headers() |
| 2361 | self.wfile.write(self.urlhandler( |
| 2362 | self.path, content_type).encode('utf-8')) |
| 2363 | |
| 2364 | def log_message(self, *args): |
| 2365 | # Don't log messages. |
nothing calls this directly
no test coverage detected