mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-02-13 13:57:59 +00:00
refactor: set header only if it not empty (#3763)
Some checks failed
Release 3X-UI / build (386) (push) Has been cancelled
Release 3X-UI / build (amd64) (push) Has been cancelled
Release 3X-UI / build (arm64) (push) Has been cancelled
Release 3X-UI / build (armv5) (push) Has been cancelled
Release 3X-UI / build (armv6) (push) Has been cancelled
Release 3X-UI / build (armv7) (push) Has been cancelled
Release 3X-UI / build (s390x) (push) Has been cancelled
Release 3X-UI / Build for Windows (push) Has been cancelled
Some checks failed
Release 3X-UI / build (386) (push) Has been cancelled
Release 3X-UI / build (amd64) (push) Has been cancelled
Release 3X-UI / build (arm64) (push) Has been cancelled
Release 3X-UI / build (armv5) (push) Has been cancelled
Release 3X-UI / build (armv6) (push) Has been cancelled
Release 3X-UI / build (armv7) (push) Has been cancelled
Release 3X-UI / build (s390x) (push) Has been cancelled
Release 3X-UI / Build for Windows (push) Has been cancelled
This commit is contained in:
parent
5bb87fd3d4
commit
25f64738e4
1 changed files with 19 additions and 5 deletions
|
|
@ -182,10 +182,24 @@ func (a *SUBController) ApplyCommonHeaders(
|
||||||
) {
|
) {
|
||||||
c.Writer.Header().Set("Subscription-Userinfo", header)
|
c.Writer.Header().Set("Subscription-Userinfo", header)
|
||||||
c.Writer.Header().Set("Profile-Update-Interval", updateInterval)
|
c.Writer.Header().Set("Profile-Update-Interval", updateInterval)
|
||||||
|
|
||||||
|
//Basics
|
||||||
|
if profileTitle != "" {
|
||||||
c.Writer.Header().Set("Profile-Title", "base64:"+base64.StdEncoding.EncodeToString([]byte(profileTitle)))
|
c.Writer.Header().Set("Profile-Title", "base64:"+base64.StdEncoding.EncodeToString([]byte(profileTitle)))
|
||||||
|
}
|
||||||
|
if profileSupportUrl != "" {
|
||||||
c.Writer.Header().Set("Support-Url", profileSupportUrl)
|
c.Writer.Header().Set("Support-Url", profileSupportUrl)
|
||||||
|
}
|
||||||
|
if profileUrl != "" {
|
||||||
c.Writer.Header().Set("Profile-Web-Page-Url", profileUrl)
|
c.Writer.Header().Set("Profile-Web-Page-Url", profileUrl)
|
||||||
|
}
|
||||||
|
if profileAnnounce != "" {
|
||||||
c.Writer.Header().Set("Announce", "base64:"+base64.StdEncoding.EncodeToString([]byte(profileAnnounce)))
|
c.Writer.Header().Set("Announce", "base64:"+base64.StdEncoding.EncodeToString([]byte(profileAnnounce)))
|
||||||
|
}
|
||||||
|
|
||||||
|
//Advanced (Happ)
|
||||||
c.Writer.Header().Set("Routing-Enable", strconv.FormatBool(profileEnableRouting))
|
c.Writer.Header().Set("Routing-Enable", strconv.FormatBool(profileEnableRouting))
|
||||||
|
if profileRoutingRules != "" {
|
||||||
c.Writer.Header().Set("Routing", profileRoutingRules)
|
c.Writer.Header().Set("Routing", profileRoutingRules)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue