You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
forgejo/routers
qwerty287 df9612bb53
Add API to serve blob or LFS file content (#19689)
* Add LFS API

* Update routers/api/v1/repo/file.go

Co-authored-by: Gusted <williamzijl7@hotmail.com>

* Apply suggestions

* Apply suggestions

* Update routers/api/v1/repo/file.go

Co-authored-by: Gusted <williamzijl7@hotmail.com>

* Report errors

* ADd test

* Use own repo for test

* Use different repo name

* Improve handling

* Slight restructures

1. Avoid reading the blob data multiple times
2. Ensure that caching is only checked when about to serve the blob/lfs
3. Avoid nesting by returning early
4. Make log message a bit more clear
5. Ensure that the dataRc is closed by defer when passed to ServeData

Signed-off-by: Andrew Thornton <art27@cantab.net>

Co-authored-by: Gusted <williamzijl7@hotmail.com>
Co-authored-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2 years ago
..
api Add API to serve blob or LFS file content (#19689) 2 years ago
common Fix raw endpoint PDF file headers (#19825) 2 years ago
install feat: add DEFAULT_MERGE_STYLE to `repository.pull-request` section for repo init (#19751) 2 years ago
private Fix spelling mistake in ProcReceive (#19853) 2 years ago
utils A better go code formatter, and now `make fmt` can run in Windows (#17684) 3 years ago
web Disable unnecessary mirroring elements (#18527) 2 years ago
init.go Update go tool dependencies (#19676) 2 years ago