@@ -235,9 +235,10 @@ File.prototype.copy = function(destination, callback) {
235
235
* with less reliability. You may also choose to skip validation completely,
236
236
* however this is **not recommended**.
237
237
* @param {number } options.start - A byte offset to begin the file's download
238
- * from. NOTE: Byte ranges are inclusive; that is, `options.start = 0` and
239
- * `options.end = 999` represent the first 1000 bytes in a file or object.
240
- * NOTE: when specifying a byte range, data integrity is not available.
238
+ * from. Default is 0. NOTE: Byte ranges are inclusive; that is,
239
+ * `options.start = 0` and `options.end = 999` represent the first 1000
240
+ * bytes in a file or object. NOTE: when specifying a byte range, data
241
+ * integrity is not available.
241
242
* @param {number } options.end - A byte offset to stop reading the file at.
242
243
* NOTE: Byte ranges are inclusive; that is, `options.start = 0` and
243
244
* `options.end = 999` represent the first 1000 bytes in a file or object.
@@ -325,8 +326,10 @@ File.prototype.createReadStream = function(options) {
325
326
} ;
326
327
327
328
if ( rangeRequest ) {
329
+ var start = util . is ( options . start , 'number' ) ? options . start : '0' ;
330
+ var end = util . is ( options . end , 'number' ) ? options . end : '' ;
328
331
reqOpts . headers = {
329
- Range : 'bytes=' + [ options . start || '' , options . end || '' ] . join ( '-' )
332
+ Range : 'bytes=' + start + '-' + end
330
333
} ;
331
334
}
332
335
0 commit comments