all repos — honk @ afb7e718df26b77b2349337087ddde6269b18427

my fork of honk

less copying of files
Ted Unangst tedu@tedunangst.com
Tue, 12 Mar 2024 21:54:58 -0400
commit

afb7e718df26b77b2349337087ddde6269b18427

parent

124c45656eefaea6bd89ac11e6589847a78c5ab3

1 files changed, 6 insertions(+), 3 deletions(-)

jump to
M web.goweb.go

@@ -2555,9 +2555,12 @@ }

xid := mux.Vars(r)["xid"] preview := r.FormValue("preview") == "1" var media string - var data []byte - row := stmtGetFileData.QueryRow(xid) - err := row.Scan(&media, &data) + var data sql.RawBytes + rows, err := stmtGetFileData.Query(xid) + if err == nil { + defer rows.Close() + err = rows.Scan(&media, &data) + } if err != nil { elog.Printf("error loading file: %s", err) http.NotFound(w, r)