forked from gitea/gitea

Backport #23146 Fixes https://github.com/go-gitea/gitea/issues/22953  Co-authored-by: yp05327 <576951401@qq.com> Co-authored-by: delvh <leon@kske.dev>