From b8fbf4109e760bb5df7e538c1246789511c9ba25 Mon Sep 17 00:00:00 2001 From: shydev Date: Tue, 2 Jun 2026 00:38:54 +0530 Subject: [PATCH] Added known HTTP header field names from W3C Trace Context (#124) 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. Co-authored-by: Guoye Zhang --- Sources/HTTPTypes/HTTPFieldName.swift | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Sources/HTTPTypes/HTTPFieldName.swift b/Sources/HTTPTypes/HTTPFieldName.swift index b4b61ed..a14a97d 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