summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--server/main.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/server/main.go b/server/main.go
index 53d1c3d..8189750 100644
--- a/server/main.go
+++ b/server/main.go
@@ -191,7 +191,10 @@ func handleGetFileInfo(w http.ResponseWriter, r *http.Request) {
}
w.Header().Set("Content-Type", "application/json")
- json.NewEncoder(w).Encode(fileInfo)
+ if err := json.NewEncoder(w).Encode(fileInfo); err != nil {
+ handleError(w, fmt.Errorf("error encoding response: %v", err), http.StatusInternalServerError)
+ return
+ }
}
func storeFileInDB(ctx context.Context, id, fileName string, encryptedData []byte) error {