fix(subscribe): escape site name in content-disposition headers
This commit is contained in:
parent
55ef348135
commit
cdc3d8b8f1
@ -2,6 +2,7 @@ package subscribe
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"net/url"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@ -228,13 +229,13 @@ func (l *SubscribeLogic) buildClientConfig(req *types.SubscribeRequest, userSub
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (l *SubscribeLogic) setClashHeaders() {
|
func (l *SubscribeLogic) setClashHeaders() {
|
||||||
l.ctx.Header("content-disposition", fmt.Sprintf("tattachment;filename*=UTF-8''%s.yaml", l.svc.Config.Site.SiteName))
|
l.ctx.Header("content-disposition", fmt.Sprintf("attachment;filename*=UTF-8''%s", url.QueryEscape(l.svc.Config.Site.SiteName)))
|
||||||
l.ctx.Header("Profile-Update-Interval", "24")
|
l.ctx.Header("Profile-Update-Interval", "24")
|
||||||
l.ctx.Header("Content-Type", "application/octet-stream; charset=UTF-8")
|
l.ctx.Header("Content-Type", "application/octet-stream; charset=UTF-8")
|
||||||
}
|
}
|
||||||
|
|
||||||
func (l *SubscribeLogic) setSurfboardHeaders() {
|
func (l *SubscribeLogic) setSurfboardHeaders() {
|
||||||
l.ctx.Header("content-disposition", fmt.Sprintf("attachment;filename*=UTF-8''%s.conf", l.svc.Config.Site.SiteName))
|
l.ctx.Header("content-disposition", fmt.Sprintf("attachment;filename*=UTF-8''%s.conf", url.QueryEscape(l.svc.Config.Site.SiteName)))
|
||||||
l.ctx.Header("Content-Type", "application/octet-stream; charset=UTF-8")
|
l.ctx.Header("Content-Type", "application/octet-stream; charset=UTF-8")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user