backblaze-b2
Advanced tools
Comparing version 0.9.7 to 0.9.8
@@ -0,1 +1,10 @@ | ||
### v0.9.8 (January 5, 2016) - The good response release | ||
Features | ||
- Updated all file functions to properly encode a fileName with a path [link](https://github.com/yakovkhalinsky/backblaze-b2/pull/10) | ||
Thanks for reporting issues for this release | ||
- [mmccallum](https://github.com/mmccallum) | ||
### v0.9.7 (January 5, 2016) - The good response release | ||
@@ -2,0 +11,0 @@ |
@@ -12,3 +12,3 @@ var sha1 = require('node-sha1'); | ||
var uploadAuthToken = args.uploadAuthToken; | ||
var filename = encodeURIComponent(args.filename); | ||
var filename = utils.getUrlEncodedFileName(args.filename); | ||
var data = args.data; | ||
@@ -70,3 +70,3 @@ var info = args.info; | ||
var bucketId = args.bucketId; | ||
var fileName = encodeURIComponent(args.fileName); | ||
var fileName = utils.getUrlEncodedFileName(args.fileName); | ||
@@ -99,3 +99,3 @@ var options = { | ||
var bucketName = args.bucketName; | ||
var fileName = encodeURIComponent(args.fileName); | ||
var fileName = utils.getUrlEncodedFileName(args.fileName); | ||
@@ -134,3 +134,3 @@ var options = { | ||
var fileId = args.fileId; | ||
var fileName = encodeURIComponent(args.fileName); | ||
var fileName = utils.getUrlEncodedFileName(args.fileName); | ||
@@ -137,0 +137,0 @@ var options = { |
@@ -71,1 +71,7 @@ | ||
}; | ||
exports.getUrlEncodedFileName = function(fileName) { | ||
return fileName.split('/') | ||
.map(encodeURIComponent) | ||
.join('/'); | ||
}; |
{ | ||
"name": "backblaze-b2", | ||
"version": "0.9.7", | ||
"version": "0.9.8", | ||
"description": "Node.js Library for the Backblaze B2 Storage Service", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -94,3 +94,3 @@ ### Backblaze B2 Node.js Library | ||
bucketId: 'bucketId', | ||
fileName: 'fileName', | ||
fileName: 'fileName' | ||
}); // returns promise | ||
@@ -97,0 +97,0 @@ |
@@ -217,2 +217,12 @@ var expect = require('expect.js'); | ||
describe('getUrlEncodedFileName', function() { | ||
it('Should correctly encode a fileName with no paths', function() { | ||
expect(utils.getUrlEncodedFileName('unicorns and rainbows !@#$%^&')).to.equal('unicorns%20and%20rainbows%20!%40%23%24%25%5E%26'); | ||
}); | ||
it('Should correctly encode a fileName with paths', function() { | ||
expect(utils.getUrlEncodedFileName('foo/bar/unicorns and rainbows !@#$%^&')).to.equal('foo/bar/unicorns%20and%20rainbows%20!%40%23%24%25%5E%26'); | ||
}); | ||
}); | ||
}); |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
61688
1471