Revision b75a5717
Added by koszko over 1 year ago
| test/server.py | ||
|---|---|---|
| 31 | 31 | from pathlib import Path | 
| 32 | 32 | from urllib.parse import parse_qs | 
| 33 | 33 | from threading import Thread | 
| 34 | import traceback | |
| 34 | 35 |  | 
| 35 | 36 | from .proxy_core import ProxyRequestHandler, ThreadingHTTPServer | 
| 36 | 37 | from .misc_constants import * | 
| ... | ... | |
| 84 | 85 |                 status_code, headers = 404, {'Content-Type': 'text/plain'}
 | 
| 85 | 86 | resp_body = b'Handler for this URL not found.' | 
| 86 | 87 |  | 
| 87 | except Exception as e: | |
| 88 |             status_code, headers, resp_body = 500, {'Content-Type': 'text/plain'}, b'Internal Error:\n' + repr(e).encode()
 | |
| 88 | except Exception: | |
| 89 | status_code = 500 | |
| 90 |             headers     = {'Content-Type': 'text/plain'}
 | |
| 91 | resp_body = b'Internal Error:\n' + traceback.format_exc().encode() | |
| 89 | 92 |  | 
| 90 | 93 | headers['Content-Length'] = str(len(resp_body)) | 
| 91 | 94 | self.send_response(status_code) | 
Also available in: Unified diff
add a repo querying HTML interface