fix: Relay 404s
This commit is contained in:
parent
d0a24a60ed
commit
c4ef20f513
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user