Improve handling of file params in lograge.
This commit is contained in:
parent
a755ff7b35
commit
9b18ee4bba
|
@ -46,7 +46,16 @@ if (Rails.env.production? && SiteSetting.logging_provider == 'lograge') || ENV["
|
||||||
exceptions = %w(controller action format id)
|
exceptions = %w(controller action format id)
|
||||||
|
|
||||||
params = event.payload[:params].except(*exceptions)
|
params = event.payload[:params].except(*exceptions)
|
||||||
params[:files].map!(&:headers) if params[:files]
|
|
||||||
|
if (file = params[:file]) && file.respond_to?(:headers)
|
||||||
|
param[:file] = file.headers
|
||||||
|
end
|
||||||
|
|
||||||
|
if (files = params[:files])
|
||||||
|
params[:files] = files.map do |file|
|
||||||
|
file.respond_to?(:headers) ? file.headers : file
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
output = {
|
output = {
|
||||||
params: params.to_query,
|
params: params.to_query,
|
||||||
|
|
Loading…
Reference in New Issue