Fix vulnerable.

This commit is contained in:
bohung committed 2022-10-25 11:48:15 +08:00
1 parent 76646d0b43
commit 79dbca5d86
1 file changed
+3 -1
@@ -7,9 +7,11 @@ module RuCaptcha
if params[:format] == "wav" and RuCaptcha.espeak?
data = generate_speech_rucaptcha
opts = { disposition: 'inline', type: 'audio/wav' }
else
elsif params[:format].blank? || params[:format] == "gif"
data = generate_rucaptcha
opts = { disposition: 'inline', type: 'image/gif' }
else
render :body => nil, :status => 404 and return
end
send_data data, opts
end