mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-12-31 23:56:34 +08:00
增强安全性
This commit is contained in:
@@ -2,6 +2,7 @@ package ui
|
||||
|
||||
import (
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/helpers"
|
||||
)
|
||||
|
||||
// 下载指定的文本内容
|
||||
@@ -16,8 +17,9 @@ func (this *DownloadAction) Init() {
|
||||
func (this *DownloadAction) RunGet(params struct {
|
||||
File string
|
||||
Text string
|
||||
|
||||
Auth *helpers.UserMustAuth
|
||||
}) {
|
||||
this.AddHeader("Content-Disposition", "attachment; filename=\""+params.File+"\";")
|
||||
this.WriteString(params.Text)
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user