diff --git a/api/file_upload_handler.go b/api/file_upload_handler.go index dfa4d4bd..4854ed17 100644 --- a/api/file_upload_handler.go +++ b/api/file_upload_handler.go @@ -5,7 +5,6 @@ import ( "encoding/json" "fmt" "io" - "log" "net/http" "strconv" @@ -126,8 +125,7 @@ func (h *ChatFileHandler) ChatFilesBySessionUUID(w http.ResponseWriter, r *http. return } w.WriteHeader(http.StatusOK) - log.Printf("chatFiles: %+v", chatFiles) - // why this? + if len(chatFiles) == 0 { w.Write([]byte("[]")) return diff --git a/api/main.go b/api/main.go index dd85ed17..4be8fd6b 100644 --- a/api/main.go +++ b/api/main.go @@ -190,10 +190,10 @@ func main() { // Set cache headers for static/assets files cacheHandler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + fmt.Println(r.URL.Path) if strings.HasPrefix(r.URL.Path, "assets/") { w.Header().Set("Cache-Control", "max-age=31536000") // 1 year - } else if r.URL.Path == "/index.html" { - // Set no cache headers for index.html + } else { w.Header().Set("Cache-Control", "no-cache, no-store, must-revalidate") w.Header().Set("Pragma", "no-cache") w.Header().Set("Expires", "0")