INNER CODE UNIT · Python
DemoHandler
shuvonsec/claude-bug-bounty · demo/app.py:130
class DemoHandler(BaseHTTPRequestHandler):
server_version = "shuvonsec/1.0"
# Quiet the default per-request access log so the recording stays clean.
def log_message(self, fmt, *args): # noqa: A003
sys.stderr.write("%s - %s\n" % (self.address_string(), fmt % args))
def _send(self, status: int, body: bytes, headers: dict) -> None:
self.send_response(status)
for k, v in headers.items():
self.send_header(k, v)
self.send_header("Content-Length", str(len(body)))
self.send_header("X-Powered-By", "shuvonsec/1.0")
self.end_headers()
self.wfile.write(body)
def do_GET(self): # noqa: N802
parsed = urllib.parse.urlparse(self.path)