mirror of https://gitee.com/bigwinds/arangodb
parent
ddd7a5b482
commit
d56fdf3b84
|
@ -3,6 +3,9 @@ v3.3.14 (2018-08-15)
|
||||||
|
|
||||||
* upgraded arangodb starter version to 0.13.1
|
* upgraded arangodb starter version to 0.13.1
|
||||||
|
|
||||||
|
* fixed issue #5736: Foxx HTTP API responds with 500 error when request body
|
||||||
|
is too short
|
||||||
|
|
||||||
* fixed issue #5831: custom queries in the ui could not be loaded if the user
|
* fixed issue #5831: custom queries in the ui could not be loaded if the user
|
||||||
only has read access to the _system database.
|
only has read access to the _system database.
|
||||||
|
|
||||||
|
|
|
@ -218,5 +218,5 @@ exports.jsonml2xml = function (jsonml, html = false, indentLevel = 0) {
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.isZipBuffer = function (buffer) {
|
exports.isZipBuffer = function (buffer) {
|
||||||
return buffer instanceof Buffer && buffer.utf8Slice(0, 4) === 'PK\u0003\u0004';
|
return buffer instanceof Buffer && buffer.length >= 4 && buffer.utf8Slice(0, 4) === 'PK\u0003\u0004';
|
||||||
};
|
};
|
||||||
|
|
|
@ -0,0 +1,19 @@
|
||||||
|
"use strict";
|
||||||
|
const util = require("@arangodb/util");
|
||||||
|
const { expect } = require("chai");
|
||||||
|
|
||||||
|
describe("isZipBuffer", () => {
|
||||||
|
const { isZipBuffer } = util;
|
||||||
|
it("handles empty buffers", () => {
|
||||||
|
const buf = new Buffer(0);
|
||||||
|
expect(isZipBuffer(buf)).to.equal(false);
|
||||||
|
});
|
||||||
|
it("recognizes zip buffers", () => {
|
||||||
|
const buf = new Buffer("PK\u0003\u0004");
|
||||||
|
expect(isZipBuffer(buf)).to.equal(true);
|
||||||
|
});
|
||||||
|
it("does not recognize non-zip buffers", () => {
|
||||||
|
const buf = new Buffer("PK\u0000\u0004");
|
||||||
|
expect(isZipBuffer(buf)).to.equal(false);
|
||||||
|
});
|
||||||
|
});
|
Loading…
Reference in New Issue