Skip to content

Commit

Permalink
Handle additional HTTP redirect status code 308 in scheduled chat req…
Browse files Browse the repository at this point in the history
…uests
  • Loading branch information
tbelbek committed Jan 16, 2025
1 parent 00843f4 commit b9c0121
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/khoj/routers/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1913,7 +1913,7 @@ def scheduled_chat(
raw_response = requests.post(url, headers=headers, json=json_payload, allow_redirects=False)

# Handle redirect manually if necessary
if raw_response.status_code in [301, 302]:
if raw_response.status_code in [301, 302, 308]:
redirect_url = raw_response.headers["Location"]
logger.info(f"Redirecting to {redirect_url}")
raw_response = requests.post(redirect_url, headers=headers, json=json_payload)
Expand Down

0 comments on commit b9c0121

Please sign in to comment.