Some improvments to slack import (#4010)

Этот коммит содержится в:
Christopher Speller
2016-09-12 11:57:36 -04:00
коммит произвёл Joram Wilander
родитель 6d21dab421
Коммит adfcda4802
4 изменённых файлов: 64 добавлений и 15 удалений

Просмотреть файл

@@ -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) {