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

Method showVerifyImage

internal/waf/captcha_validator.go:346–358  ·  view source on GitHub ↗
(actionConfig *CaptchaAction, req requests.Request, writer http.ResponseWriter)

Source from the content-addressed store, hash-verified

344}
345
346func (this *CaptchaValidator) showVerifyImage(actionConfig *CaptchaAction, req requests.Request, writer http.ResponseWriter) {
347 var captchaId = req.WAFRaw().URL.Query().Get(captchaIdName)
348 if len(captchaId) == 0 {
349 return
350 }
351
352 writer.Header().Set("Content-Type", "image/png")
353 err := captchaGenerator.WriteImage(writer, captchaId, 200, 100)
354 if err != nil {
355 logs.Error(err)
356 return
357 }
358}
359
360func (this *CaptchaValidator) validateVerifyCodeForm(actionConfig *CaptchaAction, policyId int64, groupId int64, setId int64, originURL string, req requests.Request, writer http.ResponseWriter, useLocalFirewall bool) (allow bool) {
361 var captchaId = req.WAFRaw().FormValue(captchaIdName)

Callers 1

showImageMethod · 0.95

Calls 7

WriteImageMethod · 0.80
WAFRawMethod · 0.65
GetMethod · 0.45
QueryMethod · 0.45
SetMethod · 0.45
HeaderMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected