MCPcopy Create free account
hub / github.com/GoEdgeLab/EdgeNode / show

Method show

internal/waf/captcha_validator.go:174–191  ·  view source on GitHub ↗
(actionConfig *CaptchaAction, setId int64, originURL string, req requests.Request, writer http.ResponseWriter, captchaType firewallconfigs.ServerCaptchaType)

Source from the content-addressed store, hash-verified

172}
173
174func (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
193func (this *CaptchaValidator) showImage(actionConfig *CaptchaAction, req requests.Request, writer http.ResponseWriter, captchaType firewallconfigs.ServerCaptchaType) {
194 switch captchaType {

Callers 1

RunMethod · 0.95

Calls 9

showOneClickFormMethod · 0.95
showSlideFormMethod · 0.95
showGeeTestFormMethod · 0.95
showVerifyCodesFormMethod · 0.95
RedirectMethod · 0.80
WAFServerIdMethod · 0.65
WAFRemoteIPMethod · 0.65
WAFRawMethod · 0.65
ContainsMethod · 0.45

Tested by

no test coverage detected