Merge pull request #702 from langflow-ai/fix-onedrive-redirects

fix: Follow redirects for OneDrive + SharePoint
This commit is contained in:
Sebastián Estévez 2025-12-22 21:12:21 -05:00 committed by GitHub
commit be9d9e09f0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 4 deletions

View file

@ -394,7 +394,7 @@ class OneDriveConnector(BaseConnector):
headers = {"Authorization": f"Bearer {token}"}
async with httpx.AsyncClient() as client:
response = await client.get(url, headers=headers, timeout=60)
response = await client.get(url, headers=headers, timeout=60, follow_redirects=True)
response.raise_for_status()
return response.content
@ -406,7 +406,7 @@ class OneDriveConnector(BaseConnector):
"""Download file content from direct download URL."""
try:
async with httpx.AsyncClient() as client:
response = await client.get(download_url, timeout=60)
response = await client.get(download_url, timeout=60, follow_redirects=True)
response.raise_for_status()
return response.content
except Exception as e:

View file

@ -462,7 +462,7 @@ class SharePointConnector(BaseConnector):
headers = {"Authorization": f"Bearer {token}"}
async with httpx.AsyncClient() as client:
response = await client.get(url, headers=headers, timeout=60)
response = await client.get(url, headers=headers, timeout=60, follow_redirects=True)
response.raise_for_status()
return response.content
@ -535,7 +535,7 @@ class SharePointConnector(BaseConnector):
"""Download file content from direct download URL"""
try:
async with httpx.AsyncClient() as client:
response = await client.get(download_url, timeout=60)
response = await client.get(download_url, timeout=60, follow_redirects=True)
response.raise_for_status()
return response.content
except Exception as e: