handle gzipped json

stvnrlly лет %!s(int64=10): %!d(string=назад)
Родитель
Сommit
b2ac4ae737
1 измененных файлов с 3 добавлено и 0 удалено
  1. 3 0
      app/models/agents/website_agent.rb

+ 3 - 0
app/models/agents/website_agent.rb

@@ -174,6 +174,9 @@ module Agents
174 174
         if (encoding = interpolated['force_encoding']).present?
175 175
           body = body.encode(Encoding::UTF_8, encoding)
176 176
         end
177
+        if interpolated['unzip'].present?
178
+          body = ActiveSupport::Gzip.decompress(body)
179
+        end
177 180
         doc = parse(body)
178 181
 
179 182
         if extract_full_json?