Fix vulnerable.

This commit is contained in:
BoHung Chiu 2022-10-25 12:02:54 +08:00
parent 79dbca5d86
commit cd437b485b
1 changed files with 3 additions and 0 deletions

View File

@ -4,6 +4,9 @@ module RuCaptcha
return head :ok if request.head?
headers['Cache-Control'] = 'no-cache, no-store, max-age=0, must-revalidate'
headers['Pragma'] = 'no-cache'
if params[:t].present? && (!params[:t].is_i? rescue true)
render :body => nil, :status => 404 and return
end
if params[:format] == "wav" and RuCaptcha.espeak?
data = generate_speech_rucaptcha
opts = { disposition: 'inline', type: 'audio/wav' }