working commit

This commit is contained in:
2026-02-17 19:24:29 +02:00
parent b76ea1a9ac
commit 8739f2feb7
18 changed files with 1702 additions and 756 deletions
+2 -2
View File
@@ -142,9 +142,9 @@ func (rctx *Context) SendText(statusCode int, payload string) {
rctx.Writer.Write([]byte(payload))
}
func (rctx *Context) SendBytes(statusCode int, payload []byte) {
func (rctx *Context) SendBytes(statusCode int, ctype string, payload []byte) {
size := strconv.FormatInt(int64(len(payload)), 10)
rctx.Writer.Header().Set("Content-Type", "application/octet-stream")
rctx.Writer.Header().Set("Content-Type", ctype)
rctx.Writer.Header().Set("Content-Length", size)
rctx.Writer.WriteHeader(statusCode)
rctx.Writer.Write(payload)