From d3a2c53955f28e0f3dfe0403ef691b903496e957 Mon Sep 17 00:00:00 2001 From: Gabriel Jaldon Date: Wed, 10 Dec 2014 23:21:01 +0800 Subject: Include application/javascript when checking content_type --- actionpack/lib/action_controller/metal/request_forgery_protection.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'actionpack/lib/action_controller/metal') diff --git a/actionpack/lib/action_controller/metal/request_forgery_protection.rb b/actionpack/lib/action_controller/metal/request_forgery_protection.rb index 953f3c47ed..df15c45470 100644 --- a/actionpack/lib/action_controller/metal/request_forgery_protection.rb +++ b/actionpack/lib/action_controller/metal/request_forgery_protection.rb @@ -275,7 +275,7 @@ module ActionController #:nodoc: # Check for cross-origin JavaScript responses. def non_xhr_javascript_response? # :doc: - content_type =~ %r(\Atext/javascript) && !request.xhr? + content_type =~ %r(\A(text|application)/javascript) && !request.xhr? end AUTHENTICITY_TOKEN_LENGTH = 32 -- cgit v1.2.3