[catalyst] Allow endpoint to be hit > 1 time
The nuc reboot server endpoints would deliver nothing after the
first request.
Change-Id: I5de16267a2f7ad58da2e4192997d15ec0956c626
diff --git a/cmd/catalyst/main.go b/cmd/catalyst/main.go
index ee1798d..bc2857d 100644
--- a/cmd/catalyst/main.go
+++ b/cmd/catalyst/main.go
@@ -95,11 +95,11 @@
}
mux := http.NewServeMux()
- chainloader := strings.NewReader(chainloaderExitStr)
for _, device := range devices {
endpoint := fmt.Sprintf("/%s.ipxe", device.Mac())
mux.HandleFunc(endpoint, func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Disposition", fmt.Sprintf("attachment; filename=%s.ipxe", device.Mac()))
+ chainloader := strings.NewReader(chainloaderExitStr)
io.Copy(w, chainloader)
})
}