From 954d75f81c6d8a189d91258a1faad31255147e78 Mon Sep 17 00:00:00 2001 From: Neil Lalonde Date: Mon, 6 Mar 2017 12:24:57 -0500 Subject: [PATCH] FIX: CORS middleware needs to happen earlier than AnonymousCache middleware --- config/initializers/008-rack-cors.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/initializers/008-rack-cors.rb b/config/initializers/008-rack-cors.rb index 83f77d44c1a..c5d476f715b 100644 --- a/config/initializers/008-rack-cors.rb +++ b/config/initializers/008-rack-cors.rb @@ -37,5 +37,5 @@ if GlobalSetting.enable_cors end end - Rails.configuration.middleware.use Discourse::Cors + Rails.configuration.middleware.insert_before ActionDispatch::Flash, Discourse::Cors end