Download patch_security.py from Leon4gr45/agent-0: direct link, hf CLI and curl.
- Browser
- Download file 393 Bytes
-
https://huggingface.co/spaces/Leon4gr45/agent-0/resolve/main/patch_security.py
- Command line
-
hf download hf://spaces/Leon4gr45/agent-0/patch_security.py
-
curl -L -o patch_security.py https://huggingface.co/spaces/Leon4gr45/agent-0/resolve/main/patch_security.py
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) | |