summaryrefslogtreecommitdiffstats
path: root/api/team.go
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2016-09-12 11:57:36 -0400
committerJoram Wilander <jwawilander@gmail.com>2016-09-12 11:57:36 -0400
commitadfcda48022aa8df33e5824903c15f7b9624f963 (patch)
treede8ce01f30bf7781d6bd452bc2b17f639bec35a1 /api/team.go
parent6d21dab4210678ad9305bba5ab4a341267fc29fa (diff)
downloadchat-adfcda48022aa8df33e5824903c15f7b9624f963.tar.gz
chat-adfcda48022aa8df33e5824903c15f7b9624f963.tar.bz2
chat-adfcda48022aa8df33e5824903c15f7b9624f963.zip
Some improvments to slack import (#4010)
Diffstat (limited to 'api/team.go')
-rw-r--r--api/team.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/api/team.go b/api/team.go
index 834d722ce..402a73564 100644
--- a/api/team.go
+++ b/api/team.go
@@ -7,11 +7,11 @@ import (
"bytes"
"fmt"
"html/template"
+ "io"
"net/http"
"net/url"
"strconv"
"strings"
- "time"
l4g "github.com/alecthomas/log4go"
"github.com/gorilla/mux"
@@ -896,7 +896,11 @@ 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")
- http.ServeContent(w, r, "MattermostImportLog.txt", time.Now(), bytes.NewReader(log.Bytes()))
+ if c.Err != nil {
+ w.WriteHeader(c.Err.StatusCode)
+ }
+ io.Copy(w, bytes.NewReader(log.Bytes()))
+ //http.ServeContent(w, r, "MattermostImportLog.txt", time.Now(), bytes.NewReader(log.Bytes()))
}
func getInviteInfo(c *Context, w http.ResponseWriter, r *http.Request) {