Handles the HTTP GET request. Interpret all HTTP GET requests as requests for server documentation.
(self)
| 912 | return fp.read() |
| 913 | |
| 914 | def do_GET(self): |
| 915 | """Handles the HTTP GET request. |
| 916 | |
| 917 | Interpret all HTTP GET requests as requests for server |
| 918 | documentation. |
| 919 | """ |
| 920 | # Check that the path is legal |
| 921 | if not self.is_rpc_path_valid(): |
| 922 | self.report_404() |
| 923 | return |
| 924 | |
| 925 | if self.path.endswith('.css'): |
| 926 | content_type = 'text/css' |
| 927 | response = self._get_css(self.path) |
| 928 | else: |
| 929 | content_type = 'text/html' |
| 930 | response = self.server.generate_html_documentation().encode('utf-8') |
| 931 | |
| 932 | self.send_response(200) |
| 933 | self.send_header('Content-Type', '%s; charset=UTF-8' % content_type) |
| 934 | self.send_header("Content-length", str(len(response))) |
| 935 | self.end_headers() |
| 936 | self.wfile.write(response) |
| 937 | |
| 938 | class DocXMLRPCServer( SimpleXMLRPCServer, |
| 939 | XMLRPCDocGenerator): |
nothing calls this directly
no test coverage detected