-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
Closed
Labels
Description
Description
This bug can be found in both GET endpoints: repository/contents as well as repository/contents/{filepath}
One can reproduce this bug fairly easily:
- Create a new repository. I called mine
testpct. - Clone the empty repository locally.
- Add a file whose name contains a '%' sign (e.g.
hello%mother.txt) - Add, commit and push this file.
- Using the Swagger interface or some other REST client, make a GET API call to
http://MYHOST/api/v1/repos/USERNAME/testpct/contents - This results in a 500 error whose body is simply
{
"message": "",
"url": "http://localhost:3000/api/swagger"
}- Back to your filesystem, create a folder called
folder. - Move the the file you've created into that subfolder.
- Make a GET call to
http://MYHOST/api/v1/repos/USERNAME/testpct/contents/folder - This results in the same error as the previous one.
For the record, I am well aware that having special characters in file names is bad and, no, changing these file names is not possible. :)
Gitea Version
1.17.0, 1.18.3
Can you reproduce the bug on the Gitea demo site?
Yes
Log Gist
Screenshots
No response
Git Version
No response
Operating System
Windows 10
How are you running Gitea?
- Our server is running 1.17.0, downloaded (IIRC) from the gitea.com Downloads page. The server is running as a Windows service.
- Seeing our old-ish version had a bug, I tried it locally using version 1.18.3, installed from Scoop, running from Powershell.
- Also replicated directly on https://try.gitea.io/
Database
SQLite