diff --git a/config/initializers/noosfero_urls.rb b/config/initializers/noosfero_urls.rb index 60b2a14..c4e37ee 100644 --- a/config/initializers/noosfero_urls.rb +++ b/config/initializers/noosfero_urls.rb @@ -1,5 +1,13 @@ if Rails.env == 'development' ActionController::Base.send(:prepend_before_filter) do |controller| - Noosfero.instance_variable_set('@development_url_options', { :port => controller.request.port }) + # XXX note that this is not thread-safe! Accessing a Noosfero instance in + # development mode under different ports concurrently _will_ lead to weird + # things happening. + if [80,443].include?(controller.request.port) + url_options = {} + else + url_options = { :port => controller.request.port } + end + Noosfero.instance_variable_set('@development_url_options', url_options) end end -- libgit2 0.21.2