X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/eb1c9afa9a92c1506e5d4d1161b6e74d919e8f00..1416b0952adc0bfee85e15d9c86a51c32fcfd003:/services/api/app/controllers/application_controller.rb?ds=sidebyside diff --git a/services/api/app/controllers/application_controller.rb b/services/api/app/controllers/application_controller.rb index a300476876..05b39c1aed 100644 --- a/services/api/app/controllers/application_controller.rb +++ b/services/api/app/controllers/application_controller.rb @@ -82,11 +82,17 @@ class ApplicationController < ActionController::Base end def default_url_options + options = {} if Rails.configuration.host - {:host => Rails.configuration.host} - else - {} + options[:host] = Rails.configuration.host + end + if Rails.configuration.port + options[:port] = Rails.configuration.port + end + if Rails.configuration.protocol + options[:protocol] = Rails.configuration.protocol end + options end def index @@ -383,7 +389,9 @@ class ApplicationController < ActionController::Base req_id = "req-" + Random::DEFAULT.rand(2**128).to_s(36)[0..19] end response.headers['X-Request-Id'] = Thread.current[:request_id] = req_id - yield + Rails.logger.tagged(req_id) do + yield + end Thread.current[:request_id] = nil end @@ -491,9 +499,11 @@ class ApplicationController < ActionController::Base :self_link => "", :offset => @offset, :limit => @limit, - :items => @objects.as_api_response(nil, {select: @select}), - :included => @extra_included + :items => @objects.as_api_response(nil, {select: @select}) } + if @extra_included + list[:included] = @extra_included.as_api_response(nil, {select: @select}) + end case params[:count] when nil, '', 'exact' if @objects.respond_to? :except