projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
11065: Merge branch 'master' into 11065-optional-audit-logging
[arvados.git]
/
services
/
api
/
app
/
controllers
/
application_controller.rb
diff --git
a/services/api/app/controllers/application_controller.rb
b/services/api/app/controllers/application_controller.rb
index a3004768769805ed152de177d1a69574724d80bc..05b39c1aed5f71a62b3526cc6df52e12e49022b8 100644
(file)
--- 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
end
def default_url_options
+ options = {}
if Rails.configuration.host
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
end
+ options
end
def index
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
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
Thread.current[:request_id] = nil
end
@@
-491,9
+499,11
@@
class ApplicationController < ActionController::Base
:self_link => "",
:offset => @offset,
:limit => @limit,
: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
case params[:count]
when nil, '', 'exact'
if @objects.respond_to? :except