From afb8b367ee537c58853c9b2c9a674728969f79eb Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Sun, 17 May 2026 02:58:26 +0000 Subject: [PATCH] Fix SyntaxError caused by duplicate `event_hooks` in `httpx.AsyncClient` instantiation Combined duplicated `event_hooks` keyword arguments into a single dictionary parameter with both `validate_redirect` and `verify_redirect` in `app/api/url_upload.py`. This fixes a `SyntaxError: keyword argument repeated: event_hooks` and ensures that all redirect validations run. Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com> --- app/api/url_upload.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/api/url_upload.py b/app/api/url_upload.py index 1df8d020..9f20039c 100644 --- a/app/api/url_upload.py +++ b/app/api/url_upload.py @@ -194,11 +194,10 @@ async def process_url( async with httpx.AsyncClient( timeout=settings.http_request_timeout, follow_redirects=True, - event_hooks={"response": [validate_redirect]}, + event_hooks={"response": [validate_redirect, verify_redirect]}, headers={ "User-Agent": "DocuElevate/1.0", # Identify ourselves }, - event_hooks={"response": [verify_redirect]}, ) as client: async with client.stream("GET", url) as response: response.raise_for_status()