diff --git a/CONTRIBUTORS b/CONTRIBUTORS index b6bb54b4ba1..4b723e39665 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -18,3 +18,4 @@ Patrick Costello Silvano Luciani Stephen Sawchuk Anand Suresh +Stephen Zhang diff --git a/lib/storage/file.js b/lib/storage/file.js index ba0d74a34c0..7d9e4f0bc9f 100644 --- a/lib/storage/file.js +++ b/lib/storage/file.js @@ -426,6 +426,14 @@ File.prototype.createReadStream = function(options) { b: this.bucket.name, o: encodeURIComponent(this.name) }); + if(this.bucket.name.indexOf('.') >= 0) { + // certificate error if bucket name contains dot, use JSONv1 API + remoteFilePath = util.format( + 'https://www.googleapis.com/storage/v1/b/{b}/o/{o}?alt=media', { + b: this.bucket.name, + o: encodeURIComponent(this.name) + }); + } createAuthorizedReq(remoteFilePath);