Closed
Description
Description
Hi,
URLs with an empty repository name before .git
find "random" repositories.
Example: https://gitea.com/gitea/.git/info/refs
As far as I can tell this happends because:
- The "githttp"-handling will strip
.git
from the:reponame
path parameter, i.e. ending up with an empty string:
gitea/routers/web/repo/githttp.go
Lines 59 to 107 in 4b376a0
GetRepositoryByName
uses some magic "Get" method on an partially initialized object, passing an empty string asLowerName
- but empty fields are likely not used in theWHERE
filter string for the databse.
Lines 747 to 759 in 4b376a0
Imho the most reliable solution is for GetRepositoryByName
not to find repositories with empty names.
cheers,
Stefan
Gitea Version
gitea.com doesn't say
Can you reproduce the bug on the Gitea demo site?
No
Log Gist
No response
Screenshots
No response
Git Version
No response
Operating System
No response
How are you running Gitea?
gitea.com is your instance.
Database
None