From 5b5a49e78782102fe1478a2ba60e5f1411eb952e Mon Sep 17 00:00:00 2001 From: Ayush Thakur Date: Wed, 27 May 2026 12:02:03 +0530 Subject: [PATCH] Added known HTTP header field names from W3C Trace Context These headers are defined by W3C Trace Context (https://www.w3.org/TR/trace-context/) and are used by OpenTelemetry and other distributed tracing systems. Resolves #101. --- Sources/HTTPTypes/HTTPFieldName.swift | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Sources/HTTPTypes/HTTPFieldName.swift b/Sources/HTTPTypes/HTTPFieldName.swift index f6ac897..e7773b1 100644 --- a/Sources/HTTPTypes/HTTPFieldName.swift +++ b/Sources/HTTPTypes/HTTPFieldName.swift @@ -528,6 +528,16 @@ extension HTTPField.Name { /// https://www.rfc-editor.org/rfc/rfc9110.html public static var te: Self { .init(rawName: "TE", canonicalName: "te") } + /// Traceparent + /// + /// https://www.w3.org/TR/trace-context/ + public static var traceparent: Self { .init(rawName: "Traceparent", canonicalName: "traceparent") } + + /// Tracestate + /// + /// https://www.w3.org/TR/trace-context/ + public static var tracestate: Self { .init(rawName: "Tracestate", canonicalName: "tracestate") } + /// Trailer /// /// https://www.rfc-editor.org/rfc/rfc9110.html