Skip to content

Conversation

@brendan-kellam
Copy link
Contributor

@brendan-kellam brendan-kellam commented Dec 28, 2025

Add unoptimized={true} to Image component for internal API image routes to fix broken repo images when anonymous access is disabled.

Next.js Image Optimization does not forward authentication headers when proxying internal API image URLs, causing authenticated image requests to fail. Setting unoptimized={true} bypasses the optimization, allowing the browser to make a direct request that includes necessary authentication headers.


Linear Issue: SOU-94

Open in Cursor Open in Web

Fixes #605


Note

Fixes broken repository images on authenticated instances by bypassing Next.js Image Optimization for internal API image URLs.

  • In reposTable.tsx, detect repoImageSrc starting with /api/ and set Image unoptimized to allow direct requests with auth headers
  • Update CHANGELOG.md under Unreleased to note the fix
  • Remove leftover console.log calls from repos/page.tsx

Written by Cursor Bugbot for commit e91d59d. This will update automatically on new commits. Configure here.

Co-authored-by: brendan <brendan@sourcebot.dev>
@cursor
Copy link

cursor bot commented Dec 28, 2025

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@coderabbitai
Copy link

coderabbitai bot commented Dec 28, 2025

Important

Review skipped

Auto reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch cursor/SOU-94-image-proxy-header-fix-a921

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@brendan-kellam
Copy link
Contributor Author

@cursor please look at the updated cursor rules

@cursor
Copy link

cursor bot commented Dec 28, 2025

Perfect! I can confirm that my changes comply with the cursor rules:

Indentation: All my changes use 4 spaces for indentation (you can see there are no ^I tab characters in the output)

Filename format: The file reposTable.tsx is already in camelCase format, which is consistent with the directory

My implementation is fully compliant with the project's cursor rules. The changes I made:

  1. Added 4 lines of comments (lines 113-115) with proper 4-space indentation
  2. Added 1 line of code (line 116) with proper 4-space indentation
  3. Added 1 prop to the Image component (line 128) with proper 4-space indentation

All indentation uses spaces (not tabs) and follows the existing 4-space pattern used throughout the file.


Open in Cursor Open in Web

Learn more about Cursor Agents

@brendan-kellam brendan-kellam marked this pull request as ready for review December 28, 2025 19:13
@github-actions

This comment has been minimized.

@brendan-kellam
Copy link
Contributor Author

brendan-kellam commented Dec 28, 2025

@brendan-kellam your pull request is missing a changelog!

@cursor please fix

@brendan-kellam
Copy link
Contributor Author

@cursor add a changelog entry

@cursor
Copy link

cursor bot commented Dec 28, 2025

Perfect! I've successfully added the changelog entry. Here's what I did:

Added changelog entry in the [Unreleased] section under a new ### Fixed category:

  • "Fixed repository images not loading when anonymous access is disabled. #605"

The entry follows the existing changelog format:

The github-actions bot should now be satisfied that the changelog has been updated!


Open in Cursor Open in Web

Learn more about Cursor Agents

Co-authored-by: brendan <brendan@sourcebot.dev>
@brendan-kellam
Copy link
Contributor Author

@cursor the changelog entry is incorrect. Use the Issue id for this PR, 705

@cursor
Copy link

cursor bot commented Dec 28, 2025

Perfect! I've corrected the changelog entry to reference issue #705 instead of #605. The changelog now correctly shows:

### Fixed
- Fixed repository images not loading when anonymous access is disabled. [#705](https://github.com/sourcebot-dev/sourcebot/pull/705)

Open in Cursor Open in Web

Learn more about Cursor Agents

Co-authored-by: brendan <brendan@sourcebot.dev>
@brendan-kellam brendan-kellam changed the title Image proxy header fix fix(web): Image proxy header fix Dec 28, 2025
@brendan-kellam brendan-kellam merged commit c6400ed into main Dec 28, 2025
9 checks passed
@brendan-kellam brendan-kellam deleted the cursor/SOU-94-image-proxy-header-fix-a921 branch December 28, 2025 19:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug] Repo images broken when anonymous access is not enabled

3 participants