| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -12,17 +12,6 @@ | |||
| 12 | 12 | ||
| 13 | 13 | app = FastAPI() | |
| 14 | 14 | ||
| 15 | - # --- clickjacking protection middleware --- | ||
| 16 | - @app.middleware("http") | ||
| 17 | - async def clickjacking_protect(request: Request, call_next): | ||
| 18 | - response = await call_next(request) | ||
| 19 | - user_agent = request.headers.get("user-agent", "").lower() | ||
| 20 | - if "twitterbot" in user_agent or "facebookexternalhit" in user_agent: | ||
| 21 | - return response | ||
| 22 | - response.headers["X-Frame-Options"] = "DENY" | ||
| 23 | - response.headers["Content-Security-Policy"] = "frame-ancestors 'self';" | ||
| 24 | - return response | ||
| 25 | - # --- end middleware --- | ||
| 26 | 15 | ||
| 27 | 16 | def rate_limit_exception_handler(request: Request, exc: Exception) -> Response: | |
| 28 | 17 | assert isinstance(exc, RateLimitExceeded) | |
| Back | FazBrowse Home | New Git URL |
0 commit comments