aboutsummaryrefslogtreecommitdiff
path: root/internal/route/lfs/batch.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/route/lfs/batch.go')
-rw-r--r--internal/route/lfs/batch.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/internal/route/lfs/batch.go b/internal/route/lfs/batch.go
index ae53f5d3..357aeace 100644
--- a/internal/route/lfs/batch.go
+++ b/internal/route/lfs/batch.go
@@ -166,13 +166,13 @@ const contentType = "application/vnd.git-lfs+json"
func responseJSON(w http.ResponseWriter, status int, v interface{}) {
w.Header().Set("Content-Type", contentType)
+ w.WriteHeader(status)
err := jsoniter.NewEncoder(w).Encode(v)
if err != nil {
- http.Error(w, err.Error(), http.StatusInternalServerError)
+ log.Error("Failed to encode JSON: %v", err)
return
}
- w.WriteHeader(status)
}
func internalServerError(w http.ResponseWriter) {