Tag:

通过CORS政策允许任何事情

我怎样才能禁用Cors? 出于某种原因,我狂放梳理允许的来源和标题,但我的阿贾克斯请求仍然抱怨,我的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, then short-circuit the # […]