(actionConfig *CaptchaAction, setId int64, originURL string, req requests.Request, writer http.ResponseWriter, captchaType firewallconfigs.ServerCaptchaType)
| 172 | } |
| 173 | |
| 174 | func (this *CaptchaValidator) show(actionConfig *CaptchaAction, setId int64, originURL string, req requests.Request, writer http.ResponseWriter, captchaType firewallconfigs.ServerCaptchaType) { |
| 175 | // validated yet? |
| 176 | if SharedIPWhiteList.Contains(wafutils.ComposeIPType(setId, req), actionConfig.Scope, req.WAFServerId(), req.WAFRemoteIP()) { |
| 177 | http.Redirect(writer, req.WAFRaw(), originURL, http.StatusSeeOther) |
| 178 | return |
| 179 | } |
| 180 | |
| 181 | switch captchaType { |
| 182 | case firewallconfigs.CaptchaTypeOneClick: |
| 183 | this.showOneClickForm(actionConfig, req, writer) |
| 184 | case firewallconfigs.CaptchaTypeSlide: |
| 185 | this.showSlideForm(actionConfig, req, writer) |
| 186 | case firewallconfigs.CaptchaTypeGeeTest: |
| 187 | this.showGeeTestForm(actionConfig, req, writer, originURL) |
| 188 | default: |
| 189 | this.showVerifyCodesForm(actionConfig, req, writer) |
| 190 | } |
| 191 | } |
| 192 | |
| 193 | func (this *CaptchaValidator) showImage(actionConfig *CaptchaAction, req requests.Request, writer http.ResponseWriter, captchaType firewallconfigs.ServerCaptchaType) { |
| 194 | switch captchaType { |
no test coverage detected