Environment
Chrome 136.0.7103.114
Reproduction
Go to https://ungh.cc/repos/unjs/h3/files/main.
It will redirect to https://raw.githubusercontent.com/unjs/h3/main and give you a 400 error.
Describe the bug
This issue was derived from #123 (comment).
The /repos/{owner}/{name}/files/{branch}/{...path} endpoint was intentionally changed to redirect in the commit 91ad7e2.
However, the current situation is that the /repos/{owner}/{name}/files/{branch} endpoint also redirects.
I believe that was not intended.
This endpoint is still listed in the documentation.
https://github.com/unjs/ungh/blob/main/README.md#reposownernamefilesbranch
Additional context
Since you said "PR welcome", I tried to find the cause of this problem by forking and debugging.
However, when I run npm run dev locally to start the server and access http://localhost:3000/repos/unjs/h3/files/main, it doesn't get redirected.
Do you know what's going on?
Logs
Request URL https://ungh.cc/repos/unjs/h3/files/main
Request Method GET
Status Code 302 Found
location https://raw.githubusercontent.com/unjs/h3/main
---
Request URL https://raw.githubusercontent.com/unjs/h3/main
Request Method GET
Status Code 400 Bad Request
---
400: Invalid request
Environment
Chrome 136.0.7103.114
Reproduction
Go to https://ungh.cc/repos/unjs/h3/files/main.
It will redirect to
https://raw.githubusercontent.com/unjs/h3/mainand give you a 400 error.Describe the bug
This issue was derived from #123 (comment).
The
/repos/{owner}/{name}/files/{branch}/{...path}endpoint was intentionally changed to redirect in the commit 91ad7e2.However, the current situation is that the
/repos/{owner}/{name}/files/{branch}endpoint also redirects.I believe that was not intended.
This endpoint is still listed in the documentation.
https://github.com/unjs/ungh/blob/main/README.md#reposownernamefilesbranch
Additional context
Since you said "PR welcome", I tried to find the cause of this problem by forking and debugging.
However, when I run
npm run devlocally to start the server and accesshttp://localhost:3000/repos/unjs/h3/files/main, it doesn't get redirected.Do you know what's going on?
Logs