[Git][noosfero/noosfero][api] api: (finally) fix cors application
Rodrigo Souto
gitlab at gitlab.com
Tue Jul 7 17:15:26 BRT 2015
Rodrigo Souto pushed to branch api at Noosfero / noosfero
Commits:
30352374 by Rodrigo Souto at 2015-07-07T17:11:37Z
api: (finally) fix cors application
- - - - -
2 changed files:
- config.ru
- config/application.rb
Changes:
=====================================
config.ru
=====================================
--- a/config.ru
+++ b/config.ru
@@ -6,6 +6,13 @@ require ::File.expand_path('../config/environment', __FILE__)
#use Rails::Rack::Static
#run ActionController::Dispatcher.new
+use Rack::Cors do
+ allow do
+ origins '*'
+ resource '/api/*', :headers => :any, :methods => [:get, :post]
+ end
+end
+
rails_app = Rack::Builder.new do
run Noosfero::Application
end
=====================================
config/application.rb
=====================================
--- a/config/application.rb
+++ b/config/application.rb
@@ -133,12 +133,5 @@ module Noosfero
Noosfero::Plugin.setup(config)
- config.middleware.use Rack::Cors do
- allow do
- origins '*'
- resource '/api/*', :headers => :any, :methods => [:get, :post]
- end
- end
-
end
end
View it on GitLab: https://gitlab.com/noosfero/noosfero/commit/303523746efc8d0b52d4bb21cdf5d40f30613dc4
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20150707/f986542e/attachment.html>
More information about the Noosfero-dev
mailing list