Bug: Mention avatars ignore ROOT_URL after upgrade to 1.24.7 #15073

Open
opened 2025-11-02 11:29:34 -06:00 by GiteaMirror · 1 comment
Owner

Originally created by @valentin2105 on GitHub (Oct 30, 2025).

Description

🐛 Bug: Mention avatars ignore ROOT_URL after upgrade to 1.24.7

Version:
Upgraded from 1.19.x1.24.7

Setup:

  • Gitea is hosted behind a reverse proxy

  • Public URL: https://domain.tld/gitea

  • Configured ROOT_URL in app.ini:

    [server]
    ROOT_URL = https://domain.tld/gitea/
    

Expected behavior:
When mentioning a user in an issue, PR, or comment (@username), the user’s avatar URL should respect the ROOT_URL, just like on normal pages.

Actual behavior:
After upgrading to 1.24.7, avatars for mentions are being loaded from the internal hostname instead of the configured ROOT_URL.

Example:

Correct URL (on normal pages):

https://domain.tld/gitea/avatars/8ef5c96979134bd04f6c933a9fdf2461

Incorrect URL (when mentioning a user):

https://vm-hostname.domain.tld:3000/gitea/avatars/8ef5c96979134bd04f6c933a9fdf2461

Project's avatar are impacted too.

We tried to add REVERSE_PROXY_TRUSTED_PROXIES = * and PUBLIC_URL_DETECTION = legacy but don't change anything.

Impact:
This breaks avatar loading for mentioned users when Gitea runs behind a reverse proxy or on a subpath, since the internal hostname is not accessible externally.

Steps to reproduce:

  1. Run Gitea behind a reverse proxy on a subpath, e.g. https://domain.tld/gitea.
  2. Mention a user in an issue or comment.
  3. Observe the avatar request URL in the browser’s dev tools.

Notes:

  • The behavior worked correctly on version 1.19.x.
  • It seems that avatar URLs for mentions are now built using the internal hostname/port rather than the configured ROOT_URL.

Environment:

  • Gitea 1.24.7 (binary)
  • OS: Debian 12
  • Database: PostgreSQL

Gitea Version

1.24.7

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

Debian 12

How are you running Gitea?

I use Gitea binairie with systemd

Database

PostgreSQL

Originally created by @valentin2105 on GitHub (Oct 30, 2025). ### Description ### 🐛 Bug: Mention avatars ignore `ROOT_URL` after upgrade to 1.24.7 **Version:** Upgraded from **1.19.x** → **1.24.7** **Setup:** * Gitea is hosted behind a reverse proxy * Public URL: `https://domain.tld/gitea` * Configured `ROOT_URL` in `app.ini`: ```ini [server] ROOT_URL = https://domain.tld/gitea/ ``` **Expected behavior:** When mentioning a user in an issue, PR, or comment (`@username`), the user’s **avatar URL** should respect the `ROOT_URL`, just like on normal pages. **Actual behavior:** After upgrading to 1.24.7, avatars for mentions are being loaded from the internal hostname instead of the configured `ROOT_URL`. Example: ✅ Correct URL (on normal pages): ``` https://domain.tld/gitea/avatars/8ef5c96979134bd04f6c933a9fdf2461 ``` ❌ Incorrect URL (when mentioning a user): ``` https://vm-hostname.domain.tld:3000/gitea/avatars/8ef5c96979134bd04f6c933a9fdf2461 ``` Project's avatar are impacted too. We tried to add `REVERSE_PROXY_TRUSTED_PROXIES = *` and `PUBLIC_URL_DETECTION = legacy` but don't change anything. **Impact:** This breaks avatar loading for mentioned users when Gitea runs behind a reverse proxy or on a subpath, since the internal hostname is not accessible externally. **Steps to reproduce:** 1. Run Gitea behind a reverse proxy on a subpath, e.g. `https://domain.tld/gitea`. 2. Mention a user in an issue or comment. 3. Observe the avatar request URL in the browser’s dev tools. **Notes:** * The behavior worked correctly on version **1.19.x**. * It seems that avatar URLs for mentions are now built using the internal hostname/port rather than the configured `ROOT_URL`. **Environment:** * Gitea 1.24.7 (binary) * OS: Debian 12 * Database: PostgreSQL --- ### Gitea Version 1.24.7 ### Can you reproduce the bug on the Gitea demo site? Yes ### Log Gist _No response_ ### Screenshots _No response_ ### Git Version _No response_ ### Operating System Debian 12 ### How are you running Gitea? I use Gitea binairie with systemd ### Database PostgreSQL
GiteaMirror added the issue/needs-feedback label 2025-11-02 11:29:34 -06:00
Author
Owner

@wxiaoguang commented on GitHub (Oct 31, 2025):

It's highly likely that your reverse proxy doesn't pass correct headers.

https://docs.gitea.com/administration/reverse-proxies

Make sure Host and X-Fowarded-Proto headers are correctly passed to Gitea to make Gitea see the real URL being visited.

@wxiaoguang commented on GitHub (Oct 31, 2025): It's highly likely that your reverse proxy doesn't pass correct headers. https://docs.gitea.com/administration/reverse-proxies > Make sure `Host` and `X-Fowarded-Proto` headers are correctly passed to Gitea to make Gitea see the real URL being visited.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#15073