agent-0 / patch_security.py
Leon4gr45's picture
Upload folder using huggingface_hub (part 2)
03cabce verified
Raw History Blame Contribute Delete
393 Bytes
with open("ocr/http_security.py", "r") as f:
content = f.read()
# I messed up and reverted it earlier!
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)