From f9675acba2cc21d3c8909493964c000da00b8512 Mon Sep 17 00:00:00 2001 From: Julien Lancelot Date: Mon, 21 Jan 2013 15:21:22 +0100 Subject: SONAR-2296 Sonar behind a HTTPS reverse proxy sometimes fall back to HTTP --- .../main/webapp/WEB-INF/app/controllers/application_controller.rb | 6 ++++++ sonar-server/src/main/webapp/WEB-INF/config/routes.rb | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'sonar-server/src') diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/application_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/application_controller.rb index dc8ab3d5d6d..2f765f95f1b 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/application_controller.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/application_controller.rb @@ -212,4 +212,10 @@ class ApplicationController < ActionController::Base def category_name(category) message("property.category.#{category}", :default => category) end + + # Force url_to to use relative path + def default_url_options(options) + {:only_path => true} + end + end diff --git a/sonar-server/src/main/webapp/WEB-INF/config/routes.rb b/sonar-server/src/main/webapp/WEB-INF/config/routes.rb index 6cfed6caea7..642c8d9e340 100644 --- a/sonar-server/src/main/webapp/WEB-INF/config/routes.rb +++ b/sonar-server/src/main/webapp/WEB-INF/config/routes.rb @@ -30,7 +30,7 @@ ActionController::Routing::Routes.draw do |map| map.resources 'properties', :path_prefix => 'api', :controller => 'api/properties', :requirements => { :id => /.*/ } # home page - map.home '', :controller => :dashboard, :action => :index + map.home '', :controller => :dashboard, :action => :index, :only_path => true map.root :controller => :dashboard, :action => :index # page plugins -- cgit v1.2.3