enhancements

This commit is contained in:
Alireza Ahmadi
2025-09-14 19:44:26 +02:00
parent 10025ffa66
commit 3ac1d7f546
3 changed files with 19 additions and 24 deletions

View File

@@ -1178,15 +1178,3 @@ func parseInt64(s string) (int64, error) {
n, err := strconv.ParseInt(s, 10, 64)
return n, err
}
// ApplyCommonHeaders sets standard subscription headers on the response writer.
func (s *SubService) ApplyCommonHeaders(c *gin.Context, header, updateInterval, profileTitle string) {
c.Writer.Header().Set("Subscription-Userinfo", header)
c.Writer.Header().Set("Profile-Update-Interval", updateInterval)
c.Writer.Header().Set("Profile-Title", "base64:"+base64.StdEncoding.EncodeToString([]byte(profileTitle)))
}
// ApplyBase64ContentHeader adds the full subscription content as base64 header for convenience.
func (s *SubService) ApplyBase64ContentHeader(c *gin.Context, content string) {
c.Writer.Header().Set("Subscription-Content-Base64", base64.StdEncoding.EncodeToString([]byte(content)))
}