Update routes.go

Download client's config file with the client name as the file name instead of "wg0.conf"
This commit is contained in:
Hoang Nguyen 2021-05-31 19:48:49 +07:00 committed by Hoang Nguyen
parent f2b7b3a83a
commit 756db05c7c

View file

@ -346,7 +346,7 @@ func DownloadClient() echo.HandlerFunc {
reader := strings.NewReader(config)
// set response header for downloading
c.Response().Header().Set(echo.HeaderContentDisposition, "attachment; filename=wg0.conf")
c.Response().Header().Set(echo.HeaderContentDisposition, fmt.Sprintf("attachment; filename=%s.conf", clientData.Client.Name))
return c.Stream(http.StatusOK, "text/plain", reader)
}
}