Skip to content

Commit

Permalink
Rewrite by self drawing Captcha image.
Browse files Browse the repository at this point in the history
  • Loading branch information
huacnlee committed Oct 13, 2022
1 parent 2f0a6a7 commit a875dce
Show file tree
Hide file tree
Showing 12 changed files with 860 additions and 210 deletions.
3 changes: 1 addition & 2 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ task default: :spec

task :preview do
require "rucaptcha"

res = RuCaptchaCore.create(1, 5, 1, 1)
res = RuCaptchaCore.create(5, 5)
warn res[0]
puts res[1].pack("c*")
end
3 changes: 2 additions & 1 deletion app/controllers/ru_captcha/captcha_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ def index
headers["Cache-Control"] = "no-cache, no-store, max-age=0, must-revalidate"
headers["Pragma"] = "no-cache"
data = generate_rucaptcha
opts = {disposition: "inline", type: "image/gif"}

opts = { disposition: "inline", type: "image/png" }
send_data data, opts
end
end
Expand Down
Binary file added captcha.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit a875dce

Please sign in to comment.