You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
storage.download_object() silently returns redirect body instead of file bytes when storage is backed by CDN #3
StorageClient.download_object() does not follow HTTP redirects. When the InsForge storage backend returns a 302 to the CDN (cdn.insforge.dev), httpx stops at the redirect because AsyncClient is initialized without follow_redirects=True. The method returns a StorageDownloadResult where content is the near-empty redirect body, not the actual file.
Steps to reproduce
Upload a file to a private bucket using storage.upload_object()
Download it using storage.download_object()
Inspect result.content — it will be empty bytes or a small HTML redirect body, not the uploaded file
Expected behavior
download_object() should return the actual file bytes regardless of whether InsForge serves them directly or via a CDN redirect.
Actual behavior
Returns the 302 redirect body when the bucket is CDN-backed.
download_object() calls self._client.http_client.request(...) which inherits this default. httpx.AsyncClient.request() accepts follow_redirects as a per-request parameter — the fix is straightforward.
Suggested fix
Either initialize AsyncClient with follow_redirects=True, or pass follow_redirects=True directly in the download_object request call.
Activity