Skip to content
This repository was archived by the owner on Sep 2, 2024. It is now read-only.

Commit 48cfbef

Browse files
committed
small change with return JSON after uploading file
1 parent 863afbc commit 48cfbef

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

cmd/server.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,14 @@ func (svr *devserver) upload(w http.ResponseWriter, r *http.Request) {
610610
return
611611
}
612612

613-
svr.respond(w, r, http.StatusOK, fmt.Sprintf("/_servefile_/%v", rec["id"]))
613+
var data = new(struct {
614+
ID string `json:"id"`
615+
URL string `json:"url"`
616+
})
617+
data.ID = id
618+
data.URL = fmt.Sprintf("/_servefile_/%v", rec["id"])
619+
620+
svr.respond(w, r, http.StatusOK, data)
614621
}
615622

616623
func (svr *devserver) serveFile(w http.ResponseWriter, r *http.Request) {

0 commit comments

Comments
 (0)