History

fix: prevent compression with Accept-Encoding

It seems that (apparently randomly) the index.json files are getting compressed and causing URI.open to fail. Possibly, it's a little unclear. Nonetheless, sending the "Accept-Encoding" of "identity" seems to do the trick.

Oliver Eyton-Williams committed 1 year ago

Commit 855cc081 parent cefe1af1 file · +1 −1Browse files

Unified · Split

lib/tasks/docs.thor+1−1
@@ -239,7 +239,7 @@ class DocsCLI < Thor · 238 unmodified lines
239239 ['index.json', 'meta.json'].each do |filename|
240240 json = "https://documents.devdocs.io/#{doc.path}/#{filename}?#{time}"
241241 begin
242− URI.open(json) do |file|
242+ URI.open(json, "Accept-Encoding" => "identity") do |file|
243243 mutex.synchronize do
244244 path = File.join(dir, filename)
245245 File.write(path, file.read)