File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -99,7 +99,7 @@ server = HTTP::Server.new do |context|
9999 response.headers[" Content-Type" ] = " application/zip"
100100 response.headers[" Content-Disposition" ] = " attachment; filename=\" #{ download_filename } \" "
101101 Compress ::Zip ::Writer .open(response.output) do |zip |
102- Dir .glob(" #{ request_path_absolute } /**/*" ).each do |target_path |
102+ Dir .glob(" #{ request_path_absolute } /**/*" , match_hidden: true ).each do |target_path |
103103 next if File .directory? target_path
104104 next unless File .readable? target_path
105105 relative_path = target_path.relative_to request_path_absolute
@@ -115,8 +115,7 @@ server = HTTP::Server.new do |context|
115115 root + elements[0 ..i].join(" /" )
116116 end
117117 # collect entries
118- entries = Dir [" #{ request_path_absolute } /*" ].map{|entry | entry}
119- entries = Dir [" #{ request_path_absolute } /*" ]
118+ entries = Dir .glob(" #{ request_path_absolute } /*" , match_hidden: true )
120119 dirs = entries.select{|entry | File .directory? entry}.sort
121120 files = (entries - dirs).sort
122121 sorted_entries = dirs + files
You can’t perform that action at this time.
0 commit comments