Adding new prefix

This commit is contained in:
Fabian Stamm 2018-02-25 12:24:52 +01:00
parent d778a36ea8
commit 09d996d8bc
5 changed files with 14 additions and 3 deletions

View File

@ -6,6 +6,12 @@ const btb = require("blob-to-buffer");
class SecureFile {
constructor(server, username, private_key) {
this.Server = server;
if (this.Server.endsWith("/")) {
this.Server += "api";
}
else {
this.Server += "/api";
}
this.Username = username;
this.PrivateKey = private_key;
}

View File

@ -23,6 +23,11 @@ export default class SecureFile {
private PrivateKey: string;
constructor(server: string, username: string, private_key: string) {
this.Server = server;
if (this.Server.endsWith("/")) {
this.Server += "api";
} else {
this.Server += "/api";
}
this.Username = username;
this.PrivateKey = private_key;
}

View File

@ -1,6 +1,6 @@
{
"name": "secure-file-wrapper",
"version": "1.0.4",
"version": "1.0.5",
"main": "index.js",
"author": "Fabian Stamm <dev@fabianstamm.de>",
"license": "MIT",

View File

@ -20,7 +20,7 @@ module.exports = {
setUp: function (finished) {
let pk = fs_1.readFileSync("./private.pem");
private_key = pk.toString("utf8");
sf = new index_1.default("http://localhost:3005/api", "test", private_key);
sf = new index_1.default("http://localhost:3005", "test", private_key);
finished();
},
create: async function (test) {

View File

@ -39,7 +39,7 @@ module.exports = {
setUp: function (finished) {
let pk = readFileSync("./private.pem");
private_key = pk.toString("utf8");
sf = new SecureFile("http://localhost:3005/api", "test", private_key);
sf = new SecureFile("http://localhost:3005", "test", private_key);
finished();
},
create: async function (test: TestType) {