正如标题所述,我想知道如何更改csrf-param和csrf-token的元标记名称。
<meta content="authenticity_token" name="csrf-param" />
<meta content="123456" name="csrf-token" />我问这个问题,因为出于安全原因,我想要隐藏,我用哪种技术来支持我的网站。Chrome插件Wappalyzer使用这个元标记作为Ruby on Rails的指示器。

发布于 2015-02-10 01:32:00
创建一个名为change_csrf_name.rb的初始化程序
在此文件中,您可以更改:name => 'xyz'.请注意,它可能会破坏一些您没想到的内置功能。
module ActionView
module Helpers
module CsrfHelper
def csrf_meta_tags
if protect_against_forgery?
[
tag('meta', :name => 'csrf-param', :content => request_forgery_protection_token),
tag('meta', :name => 'csrf-token', :content => form_authenticity_token)
].join("\n").html_safe
end
end
end
end
endhttps://stackoverflow.com/questions/26067588
复制相似问题