#!/usr/bin/env python3
"""Serve poc.html on :8080 for the Android Autofill out-of-bounds anchor POC.

Run on a host reachable from the Android test device, then load
http://<host>:8080/poc.html in the target (WebView app or Chrome with
"Autofill using another service" enabled). Save a credential for this
origin in the active Android Autofill service first so the FillUi has
content to display.
"""
import http.server
import socketserver
import os

PORT = 8080
os.chdir(os.path.dirname(os.path.abspath(__file__)))

class H(http.server.SimpleHTTPRequestHandler):
    def end_headers(self):
        self.send_header("Cache-Control", "no-store")
        super().end_headers()

if __name__ == "__main__":
    socketserver.TCPServer.allow_reuse_address = True
    with socketserver.TCPServer(("", PORT), H) as httpd:
        print(f"serving on http://0.0.0.0:{PORT}/poc.html")
        httpd.serve_forever()
