from http.server import BaseHTTPRequestHandler,HTTPServer
private_title=False
class Handler(BaseHTTPRequestHandler):
 def do_GET(self):
  global private_title
  if self.path.startswith('/set-shared-title'):
   private_title='private=1' in self.path
   self.send_response(200);self.end_headers();self.wfile.write(b'OK');return
  if self.path=='/shared-title-29430':
   title='Incognito title 29430' if private_title else 'Regular title 29430'
  else:
   title='Incognito secret 29430' if 'incognito' in self.path else 'Regular control 29430'
  self.send_response(200);self.send_header('Content-Type','text/html');self.end_headers()
  self.wfile.write(f'<html><head><title>{title}</title></head><body style="font:24px system-ui;padding:40px;background:#fafafa"><h1>{title}</h1><p>Synthetic local page for browser history verification.</p></body></html>'.encode())
HTTPServer(('127.0.0.1',18731),Handler).serve_forever()
