diff --git a/CONTRIBUTORS b/CONTRIBUTORS index fe06b1083d4..a387c494c87 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -12,6 +12,7 @@ # Keep the list alphabetically sorted. Anand Suresh +Ben Stahl Brett Bergmann Burcu Dogan Hector Rovira diff --git a/lib/storage/bucket.js b/lib/storage/bucket.js index faa8ccf1cf0..66fc0352515 100644 --- a/lib/storage/bucket.js +++ b/lib/storage/bucket.js @@ -973,6 +973,8 @@ Bucket.prototype.makePublic = function(options, callback) { * MD5 checksum for maximum reliability. CRC32c will provide better * performance with less reliability. You may also choose to skip validation * completely, however this is **not recommended**. + * @param {string} options.uri - The URI for an already-created resumable + * upload. See {module:storage/file#createResumableUpload}. * * @example * //- diff --git a/lib/storage/file.js b/lib/storage/file.js index ffaf7ebf475..73c5bef2fac 100644 --- a/lib/storage/file.js +++ b/lib/storage/file.js @@ -752,6 +752,8 @@ File.prototype.createResumableUpload = function(options, callback) { * MD5 checksum for maximum reliability. CRC32c will provide better * performance with less reliability. You may also choose to skip validation * completely, however this is **not recommended**. + * @param {string} options.uri - The URI for an already-created resumable + * upload. See {module:storage/file#createResumableUpload}. * * @example * var fs = require('fs'); @@ -1536,7 +1538,8 @@ File.prototype.startResumableUpload_ = function(dup, options) { metadata: options.metadata, predefinedAcl: options.predefinedAcl, private: options.private, - public: options.public + public: options.public, + uri: options.uri }); uploadStream diff --git a/package.json b/package.json index ba281f2c70e..14e48b8bc26 100644 --- a/package.json +++ b/package.json @@ -100,7 +100,7 @@ "ent": "^2.2.0", "extend": "^3.0.0", "gce-images": "^0.2.0", - "gcs-resumable-upload": "^0.5.0", + "gcs-resumable-upload": "^0.6.0", "google-auto-auth": "^0.2.0", "google-proto-files": "^0.1.1", "grpc": "^0.14.1", diff --git a/test/storage/file.js b/test/storage/file.js index 541ebd1c8cb..3aa22ffcbba 100644 --- a/test/storage/file.js +++ b/test/storage/file.js @@ -1073,6 +1073,21 @@ describe('File', function() { writable.end('data'); }); + it('should pass through a provided uri', function(done) { + var options = { + uri: 'https://www.googleapis.com/afakeuri' + }; + + var writable = file.createWriteStream(options); + + file.startResumableUpload_ = function(stream, options_) { + assert.deepEqual(options_.uri, options.uri); + done(); + }; + + writable.write('data'); + }); + describe('validation', function() { var data = 'test';