Skip to content

Commit

Permalink
Errors Comparable
Browse files Browse the repository at this point in the history
  • Loading branch information
ego008 committed May 11, 2024
1 parent 35c95d6 commit 64983a8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion controller/captcha.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package controller

import (
"bytes"
"errors"
"github.com/ego008/captcha"
"github.com/valyala/fasthttp"
"path"
Expand All @@ -26,7 +27,7 @@ func (h *BaseHandler) CaptchaHandle(ctx *fasthttp.RequestCtx) {
}
lang := strings.ToLower(string(ctx.FormValue("lang")))
download := path.Base(dir) == "download"
if captchaServeFastHTTP(ctx, id, ext, lang, download) == captcha.ErrNotFound {
if errors.Is(captchaServeFastHTTP(ctx, id, ext, lang, download), captcha.ErrNotFound) {
ctx.NotFound()
}
}
Expand Down

0 comments on commit 64983a8

Please sign in to comment.