Fix 401 on image serving with presigned S3 URLs #17

Merged
ryan merged 2 commits from fix/image-presigned-urls into main 2026-04-04 08:55:44 -04:00
Owner

Summary

  • Browser <img> tags can't attach JWT headers, causing 401 errors when loading uploaded images
  • Image endpoint now returns a time-limited presigned S3 URL (1hr expiry) instead of proxying bytes
  • Frontend fetches the presigned URL via authenticated API call, then uses it directly in <img src>

Test plan

  • Upload an image in a conversation and verify it displays
  • Reload the page and verify previously uploaded images still load
  • Verify unauthenticated requests to /api/conversation/image/<key> still return 401

🤖 Generated with Claude Code

## Summary - Browser `<img>` tags can't attach JWT headers, causing 401 errors when loading uploaded images - Image endpoint now returns a time-limited presigned S3 URL (1hr expiry) instead of proxying bytes - Frontend fetches the presigned URL via authenticated API call, then uses it directly in `<img src>` ## Test plan - [ ] Upload an image in a conversation and verify it displays - [ ] Reload the page and verify previously uploaded images still load - [ ] Verify unauthenticated requests to `/api/conversation/image/<key>` still return 401 🤖 Generated with [Claude Code](https://claude.com/claude-code)
ryan added 1 commit 2026-04-04 08:45:50 -04:00
Browser <img> tags can't attach JWT headers, causing 401s. The image
endpoint now returns a time-limited presigned S3 URL via authenticated
API call, which the frontend fetches and uses directly.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ryan added 1 commit 2026-04-04 08:49:07 -04:00
- Remove unused image_url from upload response and TS type
- Remove bare except in serve_image that masked config errors as 404s
- Add error state and broken-image placeholder in QuestionBubble

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ryan force-pushed fix/image-presigned-urls from 64dab18428 to 30db71d134 2026-04-04 08:52:32 -04:00 Compare
ryan merged commit bb3ef4fe95 into main 2026-04-04 08:55:44 -04:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: ryan/simbarag#17