File size: 344 Bytes
be6fb2e | 1 2 3 4 5 6 7 8 | with open("ocr/http_security.py", "r") as f:
content = f.read()
content = content.replace('if path not in ("/health", "/docs", "/openapi.json", "/redoc"):', 'if not any(path.rstrip("/").endswith(p) for p in ("/health", "/api-docs", "/docs", "/openapi.json", "/redoc")):')
with open("ocr/http_security.py", "w") as f:
f.write(content)
|