@warerebel/azureblobstoragehelper
Advanced tools
Comparing version 0.8.4 to 0.8.6
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const https_1 = __importDefault(require("https")); | ||
const https_1 = require("https"); | ||
const azurerestauth_1 = require("@warerebel/azurerestauth"); | ||
@@ -13,2 +10,3 @@ class AzureBlobStorage { | ||
this.knownFilesystems = []; | ||
this.agent = new https_1.Agent({ keepAlive: true, maxSockets: 100 }); | ||
} | ||
@@ -18,4 +16,5 @@ executeRequest(httpOptions, content, callback) { | ||
httpOptions.headers = {}; | ||
httpOptions.agent = this.agent; | ||
httpOptions.headers.Authorization = this.azureKeyAuth.getAuthHeaderValue(httpOptions); | ||
let request = https_1.default.request(httpOptions, (response) => { | ||
let request = https_1.request(httpOptions, (response) => { | ||
let returnedContent = ""; | ||
@@ -172,6 +171,7 @@ response.on("error", (error) => { | ||
}; | ||
getStreamOptions.agent = this.agent; | ||
getStreamOptions.headers["x-ms-date"] = new Date().toUTCString(); | ||
getStreamOptions.headers["x-ms-version"] = "2019-02-02"; | ||
getStreamOptions.headers.Authorization = this.azureKeyAuth.getAuthHeaderValue(getStreamOptions); | ||
let request = https_1.default.request(getStreamOptions, (response) => { | ||
let request = https_1.request(getStreamOptions, (response) => { | ||
callback(null, response); | ||
@@ -178,0 +178,0 @@ }); |
{ | ||
"name": "@warerebel/azureblobstoragehelper", | ||
"version": "0.8.4", | ||
"version": "0.8.6", | ||
"description": "Module to ease the storing of data in azure gen2 blob storage", | ||
@@ -35,11 +35,11 @@ "main": "dist/azureBlobStorage.js", | ||
"dependencies": { | ||
"@warerebel/azurerestauth": "^0.4.9" | ||
"@warerebel/azurerestauth": "^0.4.12" | ||
}, | ||
"devDependencies": { | ||
"@types/node": "^12.7.8", | ||
"@typescript-eslint/eslint-plugin": "^2.3.1", | ||
"@typescript-eslint/parser": "^2.3.1", | ||
"@types/node": "^12.7.11", | ||
"@typescript-eslint/eslint-plugin": "^2.3.2", | ||
"@typescript-eslint/parser": "^2.3.2", | ||
"coveralls": "^3.0.6", | ||
"eslint": "^6.4.0", | ||
"mocha": "^6.2.0", | ||
"eslint": "^6.5.1", | ||
"mocha": "^6.2.1", | ||
"nyc": "^14.1.1", | ||
@@ -46,0 +46,0 @@ "sinon": "^7.5.0", |
@@ -1,2 +0,2 @@ | ||
import https from "https"; | ||
import {request as httpsRequest, Agent} from "https"; | ||
import http from "http"; | ||
@@ -22,2 +22,3 @@ import {AzureSign, HttpOptions} from "@warerebel/azurerestauth"; | ||
knownFilesystems: String[]; | ||
agent: Agent; | ||
@@ -28,2 +29,3 @@ constructor(storageAccount: string, storageSAS: string) { | ||
this.knownFilesystems = []; | ||
this.agent = new Agent({keepAlive: true, maxSockets: 100}); | ||
} | ||
@@ -34,4 +36,5 @@ | ||
httpOptions.headers = {} | ||
httpOptions.agent = this.agent; | ||
httpOptions.headers.Authorization = this.azureKeyAuth.getAuthHeaderValue(httpOptions); | ||
let request = https.request(httpOptions, (response: http.IncomingMessage) => { | ||
let request = httpsRequest(httpOptions, (response: http.IncomingMessage) => { | ||
let returnedContent: string = ""; | ||
@@ -198,6 +201,7 @@ response.on("error", (error: Error) => { | ||
}; | ||
getStreamOptions.agent = this.agent; | ||
getStreamOptions.headers!["x-ms-date"] = new Date().toUTCString(); | ||
getStreamOptions.headers!["x-ms-version"] = "2019-02-02"; | ||
getStreamOptions.headers!.Authorization = this.azureKeyAuth.getAuthHeaderValue(getStreamOptions); | ||
let request = https.request(getStreamOptions, (response: http.IncomingMessage) => { | ||
let request = httpsRequest(getStreamOptions, (response: http.IncomingMessage) => { | ||
callback(null, response); | ||
@@ -204,0 +208,0 @@ }); |
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
64449
560