mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2025-04-19 13:32:24 +00:00
Compare commits
2 commits
aab01ff11a
...
d54e7a9b14
Author | SHA1 | Date | |
---|---|---|---|
![]() |
d54e7a9b14 | ||
![]() |
45c3d730d4 |
2 changed files with 12 additions and 4 deletions
|
@ -85,7 +85,7 @@ func (a *SUBController) subs(c *gin.Context) {
|
|||
// Add headers
|
||||
c.Writer.Header().Set("Subscription-Userinfo", header)
|
||||
c.Writer.Header().Set("Profile-Update-Interval", a.updateInterval)
|
||||
c.Writer.Header().Set("Profile-Title", a.subTitle)
|
||||
c.Writer.Header().Set("Profile-Title", "base64:" + base64.StdEncoding.EncodeToString([]byte(a.subTitle)))
|
||||
|
||||
if a.subEncrypt {
|
||||
c.String(200, base64.StdEncoding.EncodeToString([]byte(result)))
|
||||
|
@ -119,7 +119,7 @@ func (a *SUBController) subJsons(c *gin.Context) {
|
|||
// Add headers
|
||||
c.Writer.Header().Set("Subscription-Userinfo", header)
|
||||
c.Writer.Header().Set("Profile-Update-Interval", a.updateInterval)
|
||||
c.Writer.Header().Set("Profile-Title", a.subTitle)
|
||||
c.Writer.Header().Set("Profile-Title", "base64:" + base64.StdEncoding.EncodeToString([]byte(a.subTitle)))
|
||||
|
||||
c.String(200, jsonSub)
|
||||
}
|
||||
|
|
|
@ -140,8 +140,10 @@ class RandomUtil {
|
|||
|
||||
static randomShadowsocksPassword() {
|
||||
const array = new Uint8Array(32);
|
||||
|
||||
window.crypto.getRandomValues(array);
|
||||
return Base64.encode(String.fromCharCode(...array));
|
||||
|
||||
return Base64.alternativeEncode(String.fromCharCode(...array));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -528,6 +530,12 @@ class Base64 {
|
|||
)
|
||||
}
|
||||
|
||||
static alternativeEncode(content) {
|
||||
return window.btoa(
|
||||
content
|
||||
)
|
||||
}
|
||||
|
||||
static decode(content = "") {
|
||||
return new TextDecoder()
|
||||
.decode(
|
||||
|
|
Loading…
Reference in a new issue