Skip to content

Commit aa39a6a

Browse files
committed
Fix: Detect signature 0x21726152 as a rar file
1 parent 759ee60 commit aa39a6a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

scripts/file-compressed.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,9 @@ function extractZip(path, virtualPath, sha, all, json, callback)
170170
}).on('error', function(error){
171171

172172
if(/0xafbc7a37/.test(error.message)) // 7zip file
173-
fileCompressed.extract7zip(path, virtualPath, sha, all, json, callback);
173+
fileCompressed.extractRar(path, virtualPath, sha, all, json, callback);
174+
else if(/0x21726152/.test(error.message)) // rar file
175+
fileCompressed.extractRar(path, virtualPath, sha, all, json, callback);
174176
else
175177
callCallbacks([{error: ERROR_UNZIPPING_THE_FILE, detail: error.message}], waitingCurrentExtraction, callback);
176178

@@ -223,6 +225,7 @@ function extract7zip(path, virtualPath, sha, all, json, callback)
223225

224226
}).on('error', function(error){
225227

228+
console.error(error);
226229
callCallbacks([{error: ERROR_UNZIPPING_THE_FILE, detail: error.stderr}], waitingCurrentExtraction, callback);
227230

228231
});

0 commit comments

Comments
 (0)