fastify-graylog-reporter
Advanced tools
Comparing version 1.8.0 to 1.9.0
@@ -1,2 +0,2 @@ | ||
# [1.8.0](https://github.com/Blynskyniki/fastify-graylog-reporter/compare/v1.7.0...v1.8.0) (2023-10-12) | ||
# [1.9.0](https://github.com/Blynskyniki/fastify-graylog-reporter/compare/v1.8.0...v1.9.0) (2023-10-12) | ||
@@ -6,2 +6,2 @@ | ||
* add auth headers to full message ([04402c5](https://github.com/Blynskyniki/fastify-graylog-reporter/commit/04402c5e56ed2d6bf444a7df4e25334aa0c490af)) | ||
* add headers to full message ([205dbbd](https://github.com/Blynskyniki/fastify-graylog-reporter/commit/205dbbd8012d2d447729caa4b4cd56650e7885f2)) |
@@ -12,10 +12,11 @@ "use strict"; | ||
fastify.addHook('onResponse', async (request, reply) => { | ||
var _a; | ||
const { query, params, body, headers, routerMethod, routerPath } = request; | ||
try { | ||
await instance.report({ | ||
host: (headers === null || headers === void 0 ? void 0 : headers['host']) || 'empty', | ||
host: (headers === null || headers === void 0 ? void 0 : headers['host']) || ((_a = headers === null || headers === void 0 ? void 0 : headers['x-forwarded-for']) === null || _a === void 0 ? void 0 : _a[0]) || 'empty', | ||
short_message: `${routerMethod}:${routerPath} ${params ? 'params:' + JSON.stringify(params) : ''}${query ? 'query:' + JSON.stringify(query) : ''}${body ? 'body:' + JSON.stringify(body) : ''}`, | ||
path: routerPath, | ||
method: routerMethod, | ||
full_message: `token=${headers['authorization']},host=${headers === null || headers === void 0 ? void 0 : headers['host']}`, | ||
full_message: Object.keys(headers).map(key => `${key}=${headers[key]} `).join('\n'), | ||
query, | ||
@@ -22,0 +23,0 @@ uri: request.url, |
{ | ||
"name": "fastify-graylog-reporter", | ||
"version": "1.8.0", | ||
"version": "1.9.0", | ||
"description": "Fastify plugin for report request data to Graylog", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/Blynskyniki/fastify-graylog-reporter#readme", |
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
144500
295