diff --git a/internal/pages/pages.go b/internal/pages/pages.go index ef8aa94..f48420b 100644 --- a/internal/pages/pages.go +++ b/internal/pages/pages.go @@ -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)