From 59f8451ab6ac4e10ea4f5aff50fe58e4a5e167e4 Mon Sep 17 00:00:00 2001 From: "Dan G. Switzer, II" Date: Fri, 29 Aug 2025 10:29:09 -0400 Subject: [PATCH 1/2] Added new exposeTaffyHeaders to determine if Taffy debug HTTP response headers should be written --- box.json | 2 +- core/api.cfc | 42 +++++++++++++++++++++++++++--------------- docs/@next.md | 22 ++++++++++++++++++++++ package.json | 2 +- tests/Application.cfc | 1 + 5 files changed, 52 insertions(+), 17 deletions(-) diff --git a/box.json b/box.json index 70d6877c..8cf5204b 100644 --- a/box.json +++ b/box.json @@ -3,7 +3,7 @@ "shortDescription":"REST Web Service framework for ColdFusion and Lucee", "slug":"taffy", "author":"Adam Tuttle", - "version":"3.7.0", + "version":"3.8.0", "homepage":"https://taffy.io/", "documentation":"https://docs.taffy.io/", "type":"mvc", diff --git a/core/api.cfc b/core/api.cfc index 70510359..d7ae3a4f 100644 --- a/core/api.cfc +++ b/core/api.cfc @@ -65,7 +65,7 @@ - + @@ -431,19 +431,19 @@ - - + + - + - + - + - + @@ -478,7 +478,7 @@ /> - + @@ -514,7 +514,7 @@ - + @@ -528,19 +528,19 @@ - + - + - + @@ -571,7 +571,7 @@ ,_taffyRequest.statusArgs.statusCode ) /> - + #local.resultSerialized# @@ -607,10 +607,9 @@ - - + @@ -638,6 +637,7 @@ + @@ -717,6 +717,9 @@ + + + @@ -1538,4 +1541,13 @@ + + + + + + + + + diff --git a/docs/@next.md b/docs/@next.md index c46b1e04..23d69649 100644 --- a/docs/@next.md +++ b/docs/@next.md @@ -396,6 +396,7 @@ variables.framework = { unhandledPaths = "/flex2gateway", allowCrossDomain = false, + exposeTaffyHeaders = true, globalHeaders = structNew(), debugKey = "debug", @@ -575,6 +576,27 @@ variables.framework.allowCrossDomain = "http://example.com; http://foo.bar, http://google.com"; ``` +#### exposeTaffyHeaders + +**Available in:** Taffy 3.8+
+**Type:** Boolean
+**Default:** true
+**Description:** Determines if the standard Taffy debug HTTP response headers should be included with each request. The Taffy debug headers are: + +* `X-TAFFY-RELOADED` — Determines if the Taffy configuration was reloaded on the request. +* `X-TIME-TO-RELOAD` — The time it took for Taffy to initialize. +* `X-TIME-IN-PARSE` — The time it took to parse the response. +* `X-TIME-IN-ONTAFFYREQUEST` — The time spent in the `onTaffyRequest` method. +* `X-TIME-IN-RESOURCE` — The time spent executing the requested resource. +* `X-TIME-IN-CACHE-CHECK` — The time spent checking for a cached response. +* `X-TIME-IN-CACHE-GET` — The time spent to retrieve a cached response. +* `X-TIME-IN-CACHE-SAVE` — The time spent to save a cached response. +* `X-TIME-IN-SERIALIZE` — The time spent serializing the response. +* `X-TIME-IN-TAFFY` — The time spent executing the Taffy internals. +* `X-TIME-IN-ONTAFFYREQUESTEND` — The time spent in the `onTaffyRequestEnd` method. + +Setting this to `false` will prevent these response headers from being written to the HTTP stream. + #### globalHeaders **Available in:** Taffy 1.2+
diff --git a/package.json b/package.json index 9fabc4d6..1add0b95 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cfml-taffy", - "version": "3.7.0", + "version": "3.8.0", "author": "Adam Tuttle ", "license": "MIT", "homepage": "https://taffy.io", diff --git a/tests/Application.cfc b/tests/Application.cfc index 3d493d87..33785dd8 100644 --- a/tests/Application.cfc +++ b/tests/Application.cfc @@ -29,6 +29,7 @@ variables.framework.globalHeaders = {}; variables.framework.globalHeaders["x-foo-globalheader"] = "snafu"; variables.framework.exposeHeaders = true; + variables.framework.exposeTaffyHeaders = true; variables.framework.environments = {}; variables.framework.environments.test = {}; From 34088325efe32cb54ad3c868212734d724d9adf6 Mon Sep 17 00:00:00 2001 From: "Dan G. Switzer, II" Date: Fri, 29 Aug 2025 10:40:52 -0400 Subject: [PATCH 2/2] Fixed "response" to "request" --- docs/@next.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/@next.md b/docs/@next.md index 23d69649..926ab35d 100644 --- a/docs/@next.md +++ b/docs/@next.md @@ -585,7 +585,7 @@ variables.framework.allowCrossDomain = * `X-TAFFY-RELOADED` — Determines if the Taffy configuration was reloaded on the request. * `X-TIME-TO-RELOAD` — The time it took for Taffy to initialize. -* `X-TIME-IN-PARSE` — The time it took to parse the response. +* `X-TIME-IN-PARSE` — The time it took to parse the request. * `X-TIME-IN-ONTAFFYREQUEST` — The time spent in the `onTaffyRequest` method. * `X-TIME-IN-RESOURCE` — The time spent executing the requested resource. * `X-TIME-IN-CACHE-CHECK` — The time spent checking for a cached response.