newrelic 9.10.0 → 9.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/NEWS.md CHANGED
@@ -1,3 +1,7 @@
1
+ ### v9.10.1 (2023-02-13)
2
+
3
+ * Fixed error with Lambda/ALB serverless instrumentation when no response headers were included
4
+
1
5
  ### v9.10.0 (2023-02-09)
2
6
 
3
7
  * Exposed a method on [API](https://newrelic.github.io/node-newrelic/API.html#obfuscateSql) to obfuscate sql: `newrelic.obfuscateSql`.
@@ -59,7 +59,8 @@ function normalizeQueryStringParameters(event) {
59
59
  }
60
60
 
61
61
  /**
62
- * normalizes headers either from multi value headers or normal headers to a
62
+ * Normalizes both request and response headers,
63
+ * either from Multi Value headers or "normal" headers to a
63
64
  * lowercase key map with comma separated string
64
65
  *
65
66
  * @param {object} event The event with headers to normalize
@@ -67,8 +68,14 @@ function normalizeQueryStringParameters(event) {
67
68
  * @returns {Object<string, string>} The normalized headers map
68
69
  */
69
70
  function normalizeHeaders(event, lowerCaseKey = false) {
71
+ const headers = event.multiValueHeaders ?? event.headers
72
+
73
+ if (!headers) {
74
+ return
75
+ }
76
+
70
77
  return Object.fromEntries(
71
- Object.entries(event.multiValueHeaders ?? event.headers).map(([headerKey, headerValue]) => {
78
+ Object.entries(headers).map(([headerKey, headerValue]) => {
72
79
  const newKey = lowerCaseKey ? headerKey.toLowerCase() : headerKey
73
80
 
74
81
  if (Array.isArray(headerValue)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "newrelic",
3
- "version": "9.10.0",
3
+ "version": "9.10.1",
4
4
  "author": "New Relic Node.js agent team <nodejs@newrelic.com>",
5
5
  "license": "Apache-2.0",
6
6
  "contributors": [