mirror of
https://github.com/coder/coder.git
synced 2026-06-02 20:48:20 +00:00
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:
+1
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user