diff --git a/main.go b/main.go index 70ab606..d09e4f0 100644 --- a/main.go +++ b/main.go @@ -541,6 +541,7 @@ func (web *Web) watchCreatePost(c *gin.Context) { c.AbortWithError(http.StatusBadRequest, err) return } + defer openedFile.Close() jsn, _ = ioutil.ReadAll(openedFile) } else { // selected one of the templates templateFiles, err := EMBED_FS.ReadDir("watchTemplates") @@ -1207,6 +1208,7 @@ func (web *Web) importWatch(c *gin.Context) { c.AbortWithError(http.StatusBadRequest, err) return } + defer openedFile.Close() jsn, _ := ioutil.ReadAll(openedFile) export := WatchExport{} diff --git a/todo.md b/todo.md index 69705b1..1638626 100644 --- a/todo.md +++ b/todo.md @@ -13,4 +13,3 @@ - ~~restore from upload~~ - browserless function filters - url path support -- defer formfile.close() \ No newline at end of file