chore: refactor bin handler to be struct (#21917)

relates to: https://github.com/coder/internal/issues/1300

Refactors the bin handler to be a `struct` instead of a handlerfunc. The reason we want this is because we are going to introduce a cache of compressed files, so we need somewhere to put this cache.
This commit is contained in:
Spike Curtis
2026-02-06 10:41:57 +04:00
committed by GitHub
parent 541f00b903
commit 110dcbbb54
2 changed files with 64 additions and 48 deletions
+1 -1
View File
@@ -104,7 +104,7 @@ func New(opts *Options) *Handler {
}
mux := http.NewServeMux()
mux.Handle("/bin/", binHandler(opts.BinFS, newBinMetadataCache(opts.BinFS, opts.BinHashes)))
mux.Handle("/bin/", newBinHandler(opts))
mux.Handle("/", http.FileServer(
http.FS(
// OnlyFiles is a wrapper around the file system that prevents directory