Download patch_security2.py from Leon4gr45/agent-0: direct link, hf CLI and curl.
- Browser
- Download file 345 Bytes
-
https://huggingface.co/spaces/Leon4gr45/agent-0/resolve/main/patch_security2.py
- Command line
-
hf download hf://spaces/Leon4gr45/agent-0/patch_security2.py
-
curl -L -o patch_security2.py https://huggingface.co/spaces/Leon4gr45/agent-0/resolve/main/patch_security2.py
345 Bytes
| with open("ocr/http_security.py", "r") as f: | |
| content = f.read() | |
| content = content.replace('if not any(path.endswith(p) for p in ("/health", "/api-docs", "/docs", "/openapi.json", "/redoc")):', 'if path not in ("/health", "/api-docs", "/docs", "/openapi.json", "/redoc"):') | |
| with open("ocr/http_security.py", "w") as f: | |
| f.write(content) | |