| 344 | } |
| 345 | |
| 346 | func (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 | |
| 360 | func (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) |