Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

backblaze-b2

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

backblaze-b2 - npm Package Compare versions

Comparing version 0.9.9 to 0.9.10

9

CHANGELOG.md

@@ -0,1 +1,10 @@

### v0.9.10 (February 21, 2016) - The Mime release
Features
- Allow specifying mime type on upload [link](https://github.com/yakovkhalinsky/backblaze-b2/pull/14)
Thanks to the contributors for this release
- [Martin Kolárik](https://github.com/MartinKolarik)
### v0.9.9 (January 5, 2016) - The Buffer release

@@ -2,0 +11,0 @@

3

lib/actions/file.js

@@ -15,2 +15,3 @@ var sha1 = require('node-sha1');

var info = args.info;
var mime = args.mime;

@@ -22,3 +23,3 @@ var options = {

Authorization: uploadAuthToken,
'Content-Type': 'b2/x-auto',
'Content-Type': mime || 'b2/x-auto',
'X-Bz-File-Name': filename,

@@ -25,0 +26,0 @@ 'X-Bz-Content-Sha1': data ? sha1(data) : null

@@ -91,2 +91,29 @@ var actions = require('./actions');

// b2_cancel_large_file
B2.prototype.cancelLargeFile = notYetImplemented;
// b2_finish_large_file
B2.prototype.finishLargeFile = notYetImplemented;
// b2_list_parts
B2.prototype.listParts = notYetImplemented;
// b2_list_unfinished_large_files
B2.prototype.listUnfinishedLargeFiles = notYetImplemented;
// b2_start_large_file
B2.prototype.startLargeFile = notYetImplemented;
// b2_upload_part
B2.prototype.uploadPart = notYetImplemented;
var q = require('q');
function notYetImplemented() {
var deferred = q.defer();
deferred.reject('Feature not yet implemented');
return deferred.promise;
}
module.exports = B2;
{
"name": "backblaze-b2",
"version": "0.9.9",
"version": "0.9.10",
"description": "Node.js Library for the Backblaze B2 Storage Service",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -26,3 +26,8 @@ ### Backblaze B2 Node.js Library

If you are adding code, take a bit of time to add unit tests to `/test/unit`. Make sure the test is named `fooTest.js` and
Pull Requests should include:
* Updated example in README.md
* Update exiting tests, or add new tests to cover code changes
If you are adding tests, add these to `/test/unit`. Make sure the test is named `fooTest.js` and
is located in a similar folder to the node module that is being tested.

@@ -69,2 +74,3 @@

filename: 'filename',
mime: '', // optonal mime type, will default to 'b2/x-auto' if not provided
data: 'data' // this is expecting a Buffer not an encoded string,

@@ -71,0 +77,0 @@ info: {

@@ -125,2 +125,53 @@ var expect = require('expect.js');

describe('with no mime type specified', function() {
beforeEach(function(done) {
options = {
uploadUrl: 'https://uploadUrl',
uploadAuthToken: 'uploadauthtoken',
filename: 'foo.txt',
data: 'some text file content',
info: {
foo: 'bar',
unicorns: 'rainbows'
}
};
file.uploadFile(b2, options).then(function() {
done();
});
});
it('should default mime-type in headers', function() {
expect(requestOptions.headers['Content-Type']).to.equal('b2/x-auto');
});
});
describe('with mime type specified', function() {
beforeEach(function(done) {
options = {
uploadUrl: 'https://uploadUrl',
uploadAuthToken: 'uploadauthtoken',
filename: 'foo.txt',
mime: 'foo/type',
data: 'some text file content',
info: {
foo: 'bar',
unicorns: 'rainbows'
}
};
file.uploadFile(b2, options).then(function() {
done();
});
});
it('should properly mime-type in headers', function() {
expect(requestOptions.headers['Content-Type']).to.equal('foo/type');
});
});
});

@@ -127,0 +178,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc