fixes for hcaptcha, add to dmca form

This commit is contained in:
Kyle Drake 2020-11-26 01:45:23 -06:00
parent 79cdd06b19
commit 2821f513f1
9 changed files with 32 additions and 25 deletions

9
app.rb
View file

@ -11,8 +11,6 @@ use Rack::Session::Cookie, key: 'neocities',
use Rack::TempfileReaper
include Hcaptcha::Adapters::ControllerMethods
helpers do
def site_change_file_display_class(filename)
return 'html' if filename.match(Site::HTML_REGEX)
@ -24,7 +22,12 @@ helpers do
%{<input name="csrf_token" type="hidden" value="#{csrf_token}">}
end
include Hcaptcha::Adapters::ViewMethods
def hcaptcha_input
%{
<script src="https://hcaptcha.com/1/api.js" async defer></script>
<div class="h-captcha" data-sitekey="#{$config['hcaptcha_site_key']}"></div>
}
end
end
set :protection, :frame_options => "DENY"