File tree 3 files changed +3
-2
lines changed
3 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -228,7 +228,7 @@ function getEndOfCentralDirectoryRecord(self) {
228
228
229
229
function validateMetadataPath ( metadataPath , isDirectory ) {
230
230
if ( metadataPath === "" ) throw new Error ( "empty metadataPath" ) ;
231
- if ( metadataPath . indexOf ( "\\" ) !== - 1 ) throw new Error ( "invalid characters in path: " + metadataPath ) ;
231
+ metadataPath = metadataPath . replace ( / \\ / g , "/" ) ;
232
232
if ( / ^ [ a - z A - Z ] : / . test ( metadataPath ) || / ^ \/ / . test ( metadataPath ) ) throw new Error ( "absolute path: " + metadataPath ) ;
233
233
if ( metadataPath . split ( "/" ) . indexOf ( ".." ) !== - 1 ) throw new Error ( "invalid relative path: " + metadataPath ) ;
234
234
var looksLikeDirectory = / \/ $ / . test ( metadataPath ) ;
Original file line number Diff line number Diff line change 27
27
},
28
28
"devDependencies" : {
29
29
"bl" : " ~0.9.3" ,
30
- "yauzl" : " ~2.0.0 "
30
+ "yauzl" : " ~2.3.1 "
31
31
}
32
32
}
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ var BufferList = require("bl");
14
14
zipfile . addReadStream ( fs . createReadStream ( __filename ) , "readStream.txt" , fileMetadata ) ;
15
15
var expectedContents = fs . readFileSync ( __filename ) ;
16
16
zipfile . addBuffer ( expectedContents , "with/directories.txt" , fileMetadata ) ;
17
+ zipfile . addBuffer ( expectedContents , "with\\windows-paths.txt" , fileMetadata ) ;
17
18
zipfile . end ( function ( finalSize ) {
18
19
if ( finalSize !== - 1 ) throw new Error ( "finalSize is impossible to know before compression" ) ;
19
20
zipfile . outputStream . pipe ( new BufferList ( function ( err , data ) {
You can’t perform that action at this time.
0 commit comments