Skip to content

Commit 24f3c29

Browse files
author
Tension
committed
fix(subscribe): improve short token validation by adding case-insensitive comparison
1 parent 77a5373 commit 24f3c29

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

internal/handler/subscribe.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ func SubscribeHandler(svcCtx *svc.ServiceContext) func(c *gin.Context) {
3737
c.Abort()
3838
return
3939
}
40-
if short != domainArr[0] {
40+
if strings.ToLower(short) != strings.ToLower(domainArr[0]) {
41+
logger.Debugf("[SubscribeHandler] Generate short token failed, short: %s, domain: %s", short, domainArr[0])
4142
c.String(http.StatusForbidden, "Access denied")
4243
c.Abort()
4344
return

0 commit comments

Comments
 (0)