@adobe/spacecat-shared-http-utils 1.18.1 → 1.19.0

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/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ # [@adobe/spacecat-shared-http-utils-v1.19.0](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-http-utils-v1.18.2...@adobe/spacecat-shared-http-utils-v1.19.0) (2025-11-20)
2
+
3
+
4
+ ### Features
5
+
6
+ * **utils,http-utils:** trigger release for trace ID propagation ([#1154](https://github.com/adobe/spacecat-shared/issues/1154)) ([fb48149](https://github.com/adobe/spacecat-shared/commit/fb481497725e49dab18812b4ba1ba7186e35a8f9)), closes [#1152](https://github.com/adobe/spacecat-shared/issues/1152) [#1152](https://github.com/adobe/spacecat-shared/issues/1152) [#1097](https://github.com/adobe/spacecat-shared/issues/1097) [#1097](https://github.com/adobe/spacecat-shared/issues/1097) [#1097](https://github.com/adobe/spacecat-shared/issues/1097) [#1152](https://github.com/adobe/spacecat-shared/issues/1152) [adobe/spacecat-audit-worker#1520](https://github.com/adobe/spacecat-audit-worker/issues/1520)
7
+
8
+ # [@adobe/spacecat-shared-http-utils-v1.18.2](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-http-utils-v1.18.1...@adobe/spacecat-shared-http-utils-v1.18.2) (2025-11-16)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * **deps:** update external fixes ([#1132](https://github.com/adobe/spacecat-shared/issues/1132)) ([ec9b6c3](https://github.com/adobe/spacecat-shared/commit/ec9b6c38fa650176fc0b3ee06edae6639b83fcb0))
14
+
1
15
  # [@adobe/spacecat-shared-http-utils-v1.18.1](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-http-utils-v1.18.0...@adobe/spacecat-shared-http-utils-v1.18.1) (2025-11-15)
2
16
 
3
17
 
package/README.md CHANGED
@@ -3,6 +3,8 @@
3
3
  A set of TypeScript functions for creating HTTP responses with standardized formats, and classes for dealing with
4
4
  authenticating HTTP requests.
5
5
 
6
+ > **v1.19.0**: Added trace ID extraction from HTTP headers for distributed tracing support.
7
+
6
8
  ## Table of Contents
7
9
 
8
10
  - [Introduction](#introduction)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/spacecat-shared-http-utils",
3
- "version": "1.18.1",
3
+ "version": "1.19.0",
4
4
  "description": "Shared modules of the Spacecat Services - HTTP Utils",
5
5
  "type": "module",
6
6
  "engines": {
@@ -37,7 +37,7 @@
37
37
  "@adobe/fetch": "4.2.3",
38
38
  "@adobe/spacecat-shared-data-access": "2.45.0",
39
39
  "@adobe/spacecat-shared-utils": "1.66.0",
40
- "jose": "6.1.1"
40
+ "jose": "6.1.2"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@adobe/helix-shared-wrap": "2.0.2",
@@ -13,14 +13,23 @@
13
13
  export function enrichPathInfo(fn) { // export for testing
14
14
  return async (request, context) => {
15
15
  const [, route] = context?.pathInfo?.suffix?.split(/\/+/) || [];
16
+ const headers = request.headers.plain();
17
+
16
18
  context.pathInfo = {
17
19
  ...context.pathInfo,
18
20
  ...{
19
21
  method: request.method.toUpperCase(),
20
- headers: request.headers.plain(),
22
+ headers,
21
23
  route,
22
24
  },
23
25
  };
26
+
27
+ // Extract and store traceId from x-trace-id header if present
28
+ const traceIdHeader = headers['x-trace-id'];
29
+ if (traceIdHeader) {
30
+ context.traceId = traceIdHeader;
31
+ }
32
+
24
33
  return fn(request, context);
25
34
  };
26
35
  }