Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
Signed-off-by: yisaer <[email protected]>
  • Loading branch information
Yisaer committed Dec 6, 2021
1 parent 2c31bd2 commit a653167
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions server/plan_replayer.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,13 @@ func handleDownloadFile(handler downloadFileHandler, w http.ResponseWriter, req
writeError(w, err)
return
}
_, err = w.Write(content)
if err != nil {
writeError(w, err)
return
}
w.Header().Set("Content-Type", "application/zip")
w.Header().Set("Content-Disposition", fmt.Sprintf("attachment; filename=\"%s.zip\"", handler.downloadedFilename))
w.Write(content)
return
}
if handler.infoGetter == nil {
Expand Down Expand Up @@ -141,10 +145,14 @@ func handleDownloadFile(handler downloadFileHandler, w http.ResponseWriter, req
writeError(w, err)
return
}
_, err = w.Write(content)
if err != nil {
writeError(w, err)
return
}
// find dump file in one remote tidb-server, return file directly
w.Header().Set("Content-Type", "application/zip")
w.Header().Set("Content-Disposition", fmt.Sprintf("attachment; filename=\"%s.zip\"", handler.downloadedFilename))
w.Write(content)
return
}
// we can't find dump file in any tidb-server, return 404 directly
Expand Down

0 comments on commit a653167

Please sign in to comment.