From 8d7625aacdca1984c4efcb5ed8b814ca418dc706 Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Mon, 29 Apr 2019 12:03:57 +0200 Subject: [PATCH] Revert: Add base64 encoding of image Signed-off-by: Knut Ahlers --- mjpeg.go | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/mjpeg.go b/mjpeg.go index b4cf85c..cb74dd9 100644 --- a/mjpeg.go +++ b/mjpeg.go @@ -1,7 +1,6 @@ package main import ( - "encoding/base64" "fmt" "mime/multipart" "net/http" @@ -39,18 +38,13 @@ func handleMJPEG(res http.ResponseWriter, r *http.Request, imgs chan []byte, uid err := func() error { partHeader := make(textproto.MIMEHeader) partHeader.Add("Content-Type", "image/jpeg") - partHeader.Add("Content-Transfer-Encoding", "base64") partWriter, err := mimeWriter.CreatePart(partHeader) if err != nil { return errors.Wrap(err, "Unable to create mime part") } - b64w := base64.NewEncoder(base64.StdEncoding, partWriter) - defer b64w.Close() - - _, err = b64w.Write(img) - + _, err = partWriter.Write(img) return errors.Wrap(err, "Unable to write image") }()