applicationinsights
Advanced tools
Comparing version 0.17.0 to 0.17.1
@@ -1,2 +0,2 @@ | ||
///<reference path="..\Declarations\node\node.d.ts" /> | ||
///<reference path="..\typings\globals\node\index.d.ts" /> | ||
"use strict"; | ||
@@ -3,0 +3,0 @@ var __extends = (this && this.__extends) || function (d, b) { |
@@ -1,2 +0,2 @@ | ||
///<reference path="..\Declarations\node\node.d.ts" /> | ||
///<reference path="..\typings\globals\node\index.d.ts" /> | ||
"use strict"; | ||
@@ -3,0 +3,0 @@ var http = require("http"); |
@@ -1,2 +0,2 @@ | ||
///<reference path="..\Declarations\node\node.d.ts" /> | ||
///<reference path="..\typings\globals\node\index.d.ts" /> | ||
"use strict"; | ||
@@ -3,0 +3,0 @@ var ContractsModule = require("../Library/Contracts"); |
@@ -1,2 +0,2 @@ | ||
///<reference path="..\Declarations\node\node.d.ts" /> | ||
///<reference path="..\typings\globals\node\index.d.ts" /> | ||
"use strict"; | ||
@@ -3,0 +3,0 @@ var http = require("http"); |
@@ -1,2 +0,2 @@ | ||
///<reference path="..\Declarations\node\node.d.ts" /> | ||
///<reference path="..\typings\globals\node\index.d.ts" /> | ||
"use strict"; | ||
@@ -67,7 +67,8 @@ var __extends = (this && this.__extends) || function (d, b) { | ||
} | ||
newTags[ServerRequestParser.keys.locationIp] = this._getIp(); | ||
newTags[ServerRequestParser.keys.sessionId] = this._getId("ai_session"); | ||
newTags[ServerRequestParser.keys.userId] = this._getId("ai_user"); | ||
newTags[ServerRequestParser.keys.userAgent] = this.userAgent; | ||
newTags[ServerRequestParser.keys.operationName] = this.method + " " + url.parse(this.url).pathname; | ||
// don't override tags if they are already set | ||
newTags[ServerRequestParser.keys.locationIp] = tags[ServerRequestParser.keys.locationIp] || this._getIp(); | ||
newTags[ServerRequestParser.keys.sessionId] = tags[ServerRequestParser.keys.sessionId] || this._getId("ai_session"); | ||
newTags[ServerRequestParser.keys.userId] = tags[ServerRequestParser.keys.userId] || this._getId("ai_user"); | ||
newTags[ServerRequestParser.keys.userAgent] = tags[ServerRequestParser.keys.userAgent] || this.userAgent; | ||
newTags[ServerRequestParser.keys.operationName] = tags[ServerRequestParser.keys.operationName] || this.method + " " + url.parse(this.url).pathname; | ||
return newTags; | ||
@@ -74,0 +75,0 @@ }; |
@@ -1,2 +0,2 @@ | ||
///<reference path="..\Declarations\node\node.d.ts" /> | ||
///<reference path="..\typings\globals\node\index.d.ts" /> | ||
"use strict"; | ||
@@ -95,3 +95,4 @@ var http = require("http"); | ||
response.getHeader && response.setHeader && | ||
!response.getHeader(RequestResponseHeaders.targetInstrumentationKeyHeader)) { | ||
!response.getHeader(RequestResponseHeaders.targetInstrumentationKeyHeader) && | ||
!response.headersSent) { | ||
response.setHeader(RequestResponseHeaders.targetInstrumentationKeyHeader, client.config.instrumentationKeyHash); | ||
@@ -98,0 +99,0 @@ } |
@@ -0,1 +1,2 @@ | ||
///<reference path="..\typings\globals\node\index.d.ts" /> | ||
"use strict"; | ||
@@ -2,0 +3,0 @@ var url = require("url"); |
@@ -1,2 +0,2 @@ | ||
///<reference path="..\Declarations\node\node.d.ts" /> | ||
///<reference path="..\typings\globals\node\index.d.ts" /> | ||
"use strict"; | ||
@@ -3,0 +3,0 @@ var crypto = require('crypto'); |
@@ -1,2 +0,2 @@ | ||
///<reference path="..\Declarations\node\node.d.ts" /> | ||
///<reference path="..\typings\globals\node\index.d.ts" /> | ||
"use strict"; | ||
@@ -3,0 +3,0 @@ var os = require("os"); |
@@ -1,2 +0,2 @@ | ||
///<reference path="..\Declarations\node\node.d.ts" /> | ||
///<reference path="..\typings\globals\node\index.d.ts" /> | ||
"use strict"; | ||
@@ -47,3 +47,2 @@ var fs = require("fs"); | ||
}; | ||
var protocol = parsedUrl.protocol == "https:" ? https : http; | ||
zlib.gzip(payload, function (err, buffer) { | ||
@@ -63,3 +62,3 @@ var dataToSend = buffer; | ||
options[AutoCollectClientRequests.disableCollectionRequestOption] = true; | ||
var req = protocol.request(options, function (res) { | ||
var requestCallback = function (res) { | ||
res.setEncoding("utf-8"); | ||
@@ -91,3 +90,6 @@ //returns empty if the data is accepted | ||
}); | ||
}); | ||
}; | ||
var req = (parsedUrl.protocol == "https:") ? | ||
https.request(options, requestCallback) : | ||
http.request(options, requestCallback); | ||
req.on("error", function (error) { | ||
@@ -133,3 +135,3 @@ // todo: handle error codes better (group to recoverable/non-recoverable and persist) | ||
//ensure directory is created | ||
var direcotry = path.join(os.tmpDir(), Sender.TEMPDIR); | ||
var direcotry = path.join(os.tmpdir(), Sender.TEMPDIR); | ||
this._confirmDirExists(direcotry, function (error) { | ||
@@ -153,3 +155,3 @@ if (error) { | ||
Sender.prototype._storeToDiskSync = function (payload) { | ||
var direcotry = path.join(os.tmpDir(), Sender.TEMPDIR); | ||
var direcotry = path.join(os.tmpdir(), Sender.TEMPDIR); | ||
try { | ||
@@ -176,3 +178,3 @@ if (!fs.existsSync(direcotry)) { | ||
var _this = this; | ||
var tempDir = path.join(os.tmpDir(), Sender.TEMPDIR); | ||
var tempDir = path.join(os.tmpdir(), Sender.TEMPDIR); | ||
fs.exists(tempDir, function (exists) { | ||
@@ -179,0 +181,0 @@ if (exists) { |
@@ -5,3 +5,3 @@ { | ||
"bugs": "https://github.com/Microsoft/ApplicationInsights-node.js/issues", | ||
"version": "0.17.0", | ||
"version": "0.17.1", | ||
"description": "Microsoft Application Insights module for Node.JS", | ||
@@ -49,9 +49,8 @@ "repository": { | ||
"devDependencies": { | ||
"async": "^0.9.0", | ||
"chai": "^2.3.0", | ||
"mocha": "^2.2.4", | ||
"node-mocks-http": "^1.2.3", | ||
"sinon": "^1.17.6", | ||
"typescript": "^1.8.9" | ||
"mocha": "3.1.2", | ||
"node-mocks-http": "1.2.3", | ||
"sinon": "1.17.6", | ||
"typescript": "1.8.9", | ||
"typings": "2.0.0" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
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
367470
5
55
4720
12
14