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
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Correctly propagate 404s.
|
||||||
|
if resp.StatusCode == 404 {
|
||||||
|
w.WriteHeader(404)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
content, err = io.ReadAll(resp.Body)
|
content, err = io.ReadAll(resp.Body)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Errorf("Failed to get file %s/%s/%s (%s)", username, reponame, path, err)
|
log.Errorf("Failed to get file %s/%s/%s (%s)", username, reponame, path, err)
|
||||||
|
Loading…
Reference in New Issue
Block a user