From 2bf64b54c236945727a2d93afb57b1665d1daa7a Mon Sep 17 00:00:00 2001 From: George Goldberg Date: Wed, 12 Jul 2017 14:13:25 +0100 Subject: PLT-7025: Fix Slack Import API. (#6905) --- api4/team.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'api4/team.go') diff --git a/api4/team.go b/api4/team.go index 1cbd89481..98a672d93 100644 --- a/api4/team.go +++ b/api4/team.go @@ -5,7 +5,7 @@ package api4 import ( "bytes" - "io" + "encoding/base64" "net/http" "strconv" @@ -657,12 +657,12 @@ func importTeam(c *Context, w http.ResponseWriter, r *http.Request) { } } - w.Header().Set("Content-Disposition", "attachment; filename=MattermostImportLog.txt") - w.Header().Set("Content-Type", "application/octet-stream") + data := map[string]string{} + data["results"] = base64.StdEncoding.EncodeToString([]byte(log.Bytes())) if c.Err != nil { w.WriteHeader(c.Err.StatusCode) } - io.Copy(w, bytes.NewReader(log.Bytes())) + w.Write([]byte(model.MapToJson(data))) } func inviteUsersToTeam(c *Context, w http.ResponseWriter, r *http.Request) { -- cgit v1.2.3-1-g7c22