Skip to content

Commit 22b1fd9

Browse files
committed
Rebuilt.
1 parent 3474776 commit 22b1fd9

File tree

5 files changed

+55
-36
lines changed

5 files changed

+55
-36
lines changed

dist/arango.all.js

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -582,6 +582,7 @@ extend(EdgeCollection.prototype, {
582582
}
583583
});
584584
},{"./cursor":4,"./util/promisify":11,"extend":46,"util":45}],3:[function(require,module,exports){
585+
(function (Buffer){
585586
'use strict';
586587
var promisify = require('./util/promisify');
587588
var extend = require('extend');
@@ -641,16 +642,21 @@ extend(Connection.prototype, {
641642
var body = opts.body;
642643
var headers = { 'content-type': 'text/plain' };
643644

644-
if (body && typeof body === 'object') {
645-
if (opts.ld) {
646-
body = body.map(function (obj) {
647-
return JSON.stringify(obj);
648-
}).join('\r\n') + '\r\n';
649-
headers['content-type'] = 'application/x-ldjson';
645+
if (body) {
646+
if (typeof body === 'object') {
647+
if (opts.ld) {
648+
body = body.map(function (obj) {
649+
return JSON.stringify(obj);
650+
}).join('\r\n') + '\r\n';
651+
headers['content-type'] = 'application/x-ldjson';
652+
} else {
653+
body = JSON.stringify(body);
654+
headers['content-type'] = 'application/json';
655+
}
650656
} else {
651-
body = JSON.stringify(body);
652-
headers['content-type'] = 'application/json';
657+
body = String(body);
653658
}
659+
headers['content-length'] = Buffer.byteLength(body, 'utf-8');
654660
}
655661

656662
this._request({
@@ -672,7 +678,8 @@ extend(Connection.prototype, {
672678
return promise;
673679
}
674680
});
675-
},{"./error":6,"./route":8,"./util/promisify":11,"./util/request":12,"extend":46,"querystring":29}],4:[function(require,module,exports){
681+
}).call(this,require("buffer").Buffer)
682+
},{"./error":6,"./route":8,"./util/promisify":11,"./util/request":12,"buffer":14,"extend":46,"querystring":29}],4:[function(require,module,exports){
676683
'use strict';
677684
var promisify = require('./util/promisify');
678685
var extend = require('extend');

dist/arango.all.min.js

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/arango.js

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -582,6 +582,7 @@ extend(EdgeCollection.prototype, {
582582
}
583583
});
584584
},{"./cursor":4,"./util/promisify":11,"extend":"extend","util":45}],3:[function(require,module,exports){
585+
(function (Buffer){
585586
'use strict';
586587
var promisify = require('./util/promisify');
587588
var extend = require('extend');
@@ -641,16 +642,21 @@ extend(Connection.prototype, {
641642
var body = opts.body;
642643
var headers = { 'content-type': 'text/plain' };
643644

644-
if (body && typeof body === 'object') {
645-
if (opts.ld) {
646-
body = body.map(function (obj) {
647-
return JSON.stringify(obj);
648-
}).join('\r\n') + '\r\n';
649-
headers['content-type'] = 'application/x-ldjson';
645+
if (body) {
646+
if (typeof body === 'object') {
647+
if (opts.ld) {
648+
body = body.map(function (obj) {
649+
return JSON.stringify(obj);
650+
}).join('\r\n') + '\r\n';
651+
headers['content-type'] = 'application/x-ldjson';
652+
} else {
653+
body = JSON.stringify(body);
654+
headers['content-type'] = 'application/json';
655+
}
650656
} else {
651-
body = JSON.stringify(body);
652-
headers['content-type'] = 'application/json';
657+
body = String(body);
653658
}
659+
headers['content-length'] = Buffer.byteLength(body, 'utf-8');
654660
}
655661

656662
this._request({
@@ -672,7 +678,8 @@ extend(Connection.prototype, {
672678
return promise;
673679
}
674680
});
675-
},{"./error":6,"./route":8,"./util/promisify":11,"./util/request":12,"extend":"extend","querystring":29}],4:[function(require,module,exports){
681+
}).call(this,require("buffer").Buffer)
682+
},{"./error":6,"./route":8,"./util/promisify":11,"./util/request":12,"buffer":14,"extend":"extend","querystring":29}],4:[function(require,module,exports){
676683
'use strict';
677684
var promisify = require('./util/promisify');
678685
var extend = require('extend');

dist/arango.min.js

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/connection.js

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,16 +57,21 @@ extend(Connection.prototype, {
5757
var body = opts.body;
5858
var headers = { 'content-type': 'text/plain' };
5959

60-
if (body && typeof body === 'object') {
61-
if (opts.ld) {
62-
body = body.map(function (obj) {
63-
return JSON.stringify(obj);
64-
}).join('\r\n') + '\r\n';
65-
headers['content-type'] = 'application/x-ldjson';
60+
if (body) {
61+
if (typeof body === 'object') {
62+
if (opts.ld) {
63+
body = body.map(function (obj) {
64+
return JSON.stringify(obj);
65+
}).join('\r\n') + '\r\n';
66+
headers['content-type'] = 'application/x-ldjson';
67+
} else {
68+
body = JSON.stringify(body);
69+
headers['content-type'] = 'application/json';
70+
}
6671
} else {
67-
body = JSON.stringify(body);
68-
headers['content-type'] = 'application/json';
72+
body = String(body);
6973
}
74+
headers['content-length'] = Buffer.byteLength(body, 'utf-8');
7075
}
7176

7277
this._request({

0 commit comments

Comments
 (0)