Skip to content

Commit 855cc08

Browse files
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.
1 parent cefe1af commit 855cc08

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/tasks/docs.thor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ class DocsCLI < Thor
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)

0 commit comments

Comments
 (0)