mirror of
https://github.com/bestnite/sub2clash.git
synced 2025-07-04 03:52:33 +08:00
Compare commits
3 Commits
v0.0.12
...
v0.0.13-be
Author | SHA1 | Date | |
---|---|---|---|
307c36aa8d | |||
06da2e91c2 | |||
33d37e631b |
@ -33,7 +33,7 @@ func ParsePort(portStr string) (int, error) {
|
||||
}
|
||||
|
||||
func isLikelyBase64(s string) bool {
|
||||
if len(s)%4 == 0 && strings.HasSuffix(s, "=") && !strings.Contains(strings.TrimSuffix(s, "="), "=") {
|
||||
if len(s)%4 == 0 && !strings.Contains(strings.TrimSuffix(s, "="), "=") {
|
||||
s = strings.TrimSuffix(s, "=")
|
||||
chars := "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
|
||||
for _, c := range s {
|
||||
|
@ -27,10 +27,9 @@ func SubHandler(model M.ClashType, template string) func(c *gin.Context) {
|
||||
|
||||
if len(query.Subs) == 1 {
|
||||
userInfoHeader, err := common.FetchSubscriptionUserInfo(query.Subs[0], "clash", config.GlobalConfig.RequestRetryTimes)
|
||||
if err != nil {
|
||||
c.String(http.StatusInternalServerError, err.Error())
|
||||
if err == nil {
|
||||
c.Header("subscription-userinfo", userInfoHeader)
|
||||
}
|
||||
c.Header("subscription-userinfo", userInfoHeader)
|
||||
}
|
||||
|
||||
if query.NodeListMode {
|
||||
|
@ -55,7 +55,7 @@
|
||||
<label for="endpoint">客户端类型:</label>
|
||||
<select class="form-control" id="endpoint" name="endpoint">
|
||||
<option value="clash">Clash</option>
|
||||
<option value="meta">Clash.Meta</option>
|
||||
<option value="meta" selected>Clash.Meta</option>
|
||||
</select>
|
||||
</div>
|
||||
<!-- Template -->
|
||||
@ -75,9 +75,9 @@
|
||||
</div>
|
||||
<!-- User Agent -->
|
||||
<div class="form-group mb-3">
|
||||
<label for="user-agent">ua标识:</label>
|
||||
<label for="user-agent">UA 标识:</label>
|
||||
<textarea class="form-control" id="user-agent" name="user-agent"
|
||||
placeholder="用于获取订阅的http请求中的user-agent标识(可选)" rows="3"></textarea>
|
||||
placeholder="用于获取订阅的 http 请求中的 User-Agent 标识(可选)" rows="3"></textarea>
|
||||
</div>
|
||||
<!-- Refresh -->
|
||||
<div class="form-check mb-3">
|
||||
|
Reference in New Issue
Block a user