Skip to content

Commit

Permalink
feat: response 400 when use external image url
Browse files Browse the repository at this point in the history
  • Loading branch information
JingYiJun committed Mar 30, 2024
1 parent 96a8b71 commit f762e3d
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions utils/sensitive/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package sensitive

import (
"fmt"
"github.com/opentreehole/go-common"
"github.com/yidun/yidun-golang-sdk/yidun/service/antispam/image/v5"
"github.com/yidun/yidun-golang-sdk/yidun/service/antispam/image/v5/check"
"strconv"
Expand Down Expand Up @@ -42,10 +43,7 @@ func CheckSensitive(params ParamsForCheck) (resp *ResponseForCheck, err error) {
return nil, err
}
if !pass {
return &ResponseForCheck{
Pass: false,
Labels: nil,
}, nil
return nil, common.BadRequest("不允许使用外部图片链接")
}

ret, err := checkSensitiveImage(ParamsForCheck{
Expand Down

0 comments on commit f762e3d

Please sign in to comment.