nock
Advanced tools
Comparing version 13.5.3 to 13.5.4
@@ -201,6 +201,12 @@ 'use strict' | ||
} | ||
const readStream = fs.createReadStream(filePath) | ||
readStream.pause() | ||
this.filePath = filePath | ||
return this.reply(statusCode, readStream, headers) | ||
return this.reply( | ||
statusCode, | ||
() => { | ||
const readStream = fs.createReadStream(filePath) | ||
readStream.pause() | ||
return readStream | ||
}, | ||
headers, | ||
) | ||
} | ||
@@ -457,11 +463,2 @@ | ||
if ( | ||
(this.scope.shouldPersist() || this.counter > 0) && | ||
this.interceptionCounter > 1 && | ||
this.filePath | ||
) { | ||
this.body = fs.createReadStream(this.filePath) | ||
this.body.pause() | ||
} | ||
remove(this) | ||
@@ -468,0 +465,0 @@ |
@@ -10,3 +10,3 @@ { | ||
], | ||
"version": "13.5.3", | ||
"version": "13.5.4", | ||
"author": "Pedro Teixeira <pedro.teixeira@gmail.com>", | ||
@@ -49,3 +49,3 @@ "repository": { | ||
"nyc": "^15.0.0", | ||
"prettier": "3.1.0", | ||
"prettier": "3.2.4", | ||
"proxyquire": "^2.1.0", | ||
@@ -52,0 +52,0 @@ "rimraf": "^3.0.0", |
186763
3612