7
通过CORS政策允许任何内容
如何禁用cors?出于某种原因,我通配了允许的来源和标头,但我的ajax请求仍然抱怨我的CORS策略不允许该来源...。 我的应用程序控制器: class ApplicationController < ActionController::Base protect_from_forgery before_filter :current_user, :cors_preflight_check after_filter :cors_set_access_control_headers # For all responses in this controller, return the CORS access control headers. def cors_set_access_control_headers headers['Access-Control-Allow-Origin'] = '*' headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS' headers['Access-Control-Allow-Headers'] = '*' headers['Access-Control-Max-Age'] = "1728000" end # If this is a preflight OPTIONS request, …
100
ruby-on-rails
cors