fix: Relay 404s

This commit is contained in:
PapaTutuWawa 2024-01-01 14:52:05 +01:00
parent d0a24a60ed
commit c4ef20f513

View File

@ -95,6 +95,12 @@ func ServeFile(username, reponame, path, giteaUrl string, w http.ResponseWriter)
return
}
// Correctly propagate 404s.
if resp.StatusCode == 404 {
w.WriteHeader(404)
return
}
content, err = io.ReadAll(resp.Body)
if err != nil {
log.Errorf("Failed to get file %s/%s/%s (%s)", username, reponame, path, err)