Compare commits

...

3 Commits

Author SHA1 Message Date
cf1fc0a32b updated filepattern regex
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
continuous-integration/drone Build is passing
2024-02-11 12:39:20 +01:00
aa24960df1 updated filepattern regex
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2023-11-27 09:29:38 +01:00
1153b3515f added health check endpoint
All checks were successful
continuous-integration/drone/tag Build is passing
continuous-integration/drone/push Build is passing
2023-07-15 19:36:00 +02:00
2 changed files with 5 additions and 1 deletions

2
src/cache/cache.go vendored
View File

@ -18,7 +18,7 @@ import (
"time"
)
var filepattern = regexp.MustCompile(`((In)?Release(\.gpg)?|Packages\.(gz|bz2)|Contents-(arm64|armhf|amd64)(\.gz)?)`)
var filepattern = regexp.MustCompile(`((In)?Release(\.gpg)?|Packages(\.gz|\.bz2)?|Contents-(arm64|armhf|amd64)(\.gz)|Sources.bz2?)`)
// Reader is a generic interface for reading cache entries either from disk or
// directly attached to a downloader.

View File

@ -64,6 +64,10 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, req *http.Request) {
http.Error(w, "method not allowed", http.StatusMethodNotAllowed)
return
}
if req.RequestURI == "/health" {
http.Error(w, "OK", http.StatusOK)
return
}
r, err := s.cache.GetReader(rewrite(req.RequestURI), maxAge(req))
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)