+5
-5
@@ -143,7 +143,7 @@ func ApiHandler(ctx *gin.Context) {
|
||||
key = "profile_info_result"
|
||||
}
|
||||
default:
|
||||
// fmt.Println("Fuck you!")
|
||||
// fmt.Println(ErrorMsg)
|
||||
fmt.Println(v)
|
||||
err = errors.New("invalid option")
|
||||
}
|
||||
@@ -183,24 +183,24 @@ func ApiHandler(ctx *gin.Context) {
|
||||
authorizeStr := ctx.Request.Header["Authorize"]
|
||||
authToken, err := utils.GetAuthorizeToken(authorizeStr)
|
||||
if err != nil {
|
||||
ctx.String(http.StatusForbidden, "Fuck you!")
|
||||
ctx.String(http.StatusForbidden, ErrorMsg)
|
||||
return
|
||||
}
|
||||
userId := ctx.Request.Header[http.CanonicalHeaderKey("User-ID")]
|
||||
if len(userId) == 0 {
|
||||
ctx.String(http.StatusForbidden, "Fuck you!")
|
||||
ctx.String(http.StatusForbidden, ErrorMsg)
|
||||
return
|
||||
}
|
||||
|
||||
if !database.MatchTokenUid(authToken, userId[0]) {
|
||||
ctx.String(http.StatusForbidden, "Fuck you!")
|
||||
ctx.String(http.StatusForbidden, ErrorMsg)
|
||||
return
|
||||
}
|
||||
|
||||
nonce, err := utils.GetAuthorizeNonce(authorizeStr)
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
ctx.String(http.StatusForbidden, "Fuck you!")
|
||||
ctx.String(http.StatusForbidden, ErrorMsg)
|
||||
return
|
||||
}
|
||||
nonce++
|
||||
|
||||
Reference in New Issue
Block a user