Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
cf1fc0a32b | |||
aa24960df1 | |||
1153b3515f |
2
src/cache/cache.go
vendored
2
src/cache/cache.go
vendored
@ -18,7 +18,7 @@ import (
|
|||||||
"time"
|
"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
|
// Reader is a generic interface for reading cache entries either from disk or
|
||||||
// directly attached to a downloader.
|
// directly attached to a downloader.
|
||||||
|
@ -64,6 +64,10 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
|||||||
http.Error(w, "method not allowed", http.StatusMethodNotAllowed)
|
http.Error(w, "method not allowed", http.StatusMethodNotAllowed)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if req.RequestURI == "/health" {
|
||||||
|
http.Error(w, "OK", http.StatusOK)
|
||||||
|
return
|
||||||
|
}
|
||||||
r, err := s.cache.GetReader(rewrite(req.RequestURI), maxAge(req))
|
r, err := s.cache.GetReader(rewrite(req.RequestURI), maxAge(req))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
http.Error(w, err.Error(), http.StatusInternalServerError)
|
http.Error(w, err.Error(), http.StatusInternalServerError)
|
||||||
|
Loading…
Reference in New Issue
Block a user