2022-01-01 13:38:12 +00:00
|
|
|
# Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
|
2021-06-01 12:20:20 +00:00
|
|
|
|
2018-07-11 09:01:54 +00:00
|
|
|
class Issue2100Utf8EncodeHttpLogs < ActiveRecord::Migration[5.1]
|
|
|
|
def up
|
|
|
|
HttpLog.where('request LIKE :enctag OR response LIKE :enctag', enctag: '%content: !binary |%')
|
|
|
|
.limit(100_000)
|
|
|
|
.order(created_at: :desc)
|
|
|
|
.find_each do |log|
|
2018-12-19 17:31:51 +00:00
|
|
|
log.update(request: log.request.transform_values(&:utf8_encode),
|
2018-07-11 09:01:54 +00:00
|
|
|
response: log.response.transform_values(&:utf8_encode))
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|