我在我的应用程序中使用了刹车手来生成扫描报告。它以高置信度生成了许多跨站点脚本安全警告。其中之一是:
Unescaped parameter value rendered inline near line 47: render(text => "Unexpected EventType #{params["EventType"]}", { :status => 406 })
app/controllers/event_controller.rb.
在下面显示的控制器方法中,第一行显示上述警告。
我在链接中看到但无法修复。请帮忙。这是控制器代码:
def purchase
render :status => 406, :text => "Unexpected EventType #{params['EventType']}" and return unless params['EventType'] == 'purchased'
@account = Account.new
render :status => 406, :text => "Could not find Plan #{params['Plan']}" and return unless @account.plan = @plan = SubscriptionPlan.find_by_name(params['Plan'])
end