Skip to content

CF2025: Removing deprecated cfheader StatusText attribute #449

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

rlorenzo
Copy link

@rlorenzo rlorenzo commented Jul 29, 2025

  • Attribute is no longer available in ColdFusion 2025. Using it causes an "Attribute validation error for CFHEADER tag".

Let me know if you wanted to have some backwards compatibility code to still retain StatusText for older versions of ColdFusion.

Copy link

netlify bot commented Jul 29, 2025

Deploy Preview for taffy-docs canceled.

Name Link
🔨 Latest commit b34c218
🔍 Latest deploy log https://app.netlify.com/projects/taffy-docs/deploys/6890f934c6a4960009e5b516

@rlorenzo rlorenzo changed the title Removing deprecated cfheader StatusText attribute CF2025: Removing deprecated cfheader StatusText attribute Jul 29, 2025
@rlorenzo rlorenzo force-pushed the statustext-deprecation branch 2 times, most recently from 3e540df to 1705875 Compare July 29, 2025 01:43
@atuttle
Copy link
Owner

atuttle commented Jul 29, 2025

Yes, backwards compatibility is still desired.

rlorenzo added 2 commits July 29, 2025 18:01
* Attribute is no longer available in ColdFusion 2025. Using it causes
an "Attribute validation error for CFHEADER tag".
- Create cfHeaderUtils.cfc to detect CF version and conditionally use statusText
- Add cfHeaderHelper.cfm with global setTaffyStatusHeader() function
- Update all cfheader calls to use the new compatibility layer
- Add comprehensive test coverage for version detection and header setting
@rlorenzo rlorenzo force-pushed the statustext-deprecation branch from 1705875 to c1d2e7a Compare August 4, 2025 18:10
@Copilot Copilot AI review requested due to automatic review settings August 4, 2025 18:10
@rlorenzo
Copy link
Author

rlorenzo commented Aug 4, 2025

@atuttle I added a compatibility layer. The code should work for CF8+.

Copilot

This comment was marked as outdated.

@rlorenzo rlorenzo requested a review from Copilot August 4, 2025 18:19
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Removes the deprecated statustext attribute from cfheader tags to ensure compatibility with ColdFusion 2025, where this attribute is no longer supported and causes validation errors.

  • Creates a backwards-compatible header utility system that detects CF version and conditionally uses statustext
  • Introduces comprehensive test coverage for the new header utilities
  • Replaces all direct cfheader calls with the new compatible wrapper functions

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
core/cfHeaderUtils.cfc New utility component providing version detection and backwards-compatible header setting
core/cfHeaderHelper.cfm Global function wrapper for the header utility with application-scoped caching
core/api.cfc Updates to use new header utility instead of direct cfheader calls
core/baseDeserializer.cfc Integration of header utility for error handling
bonus/LogToScreen.cfc Replacement of cfheader with global helper function
dashboard/asset.cfm Replacement of cfheader with global helper function
tests/tests/run.cfm Replacement of cfheader with global helper function
tests/tests/TestCfHeaderUtils.cfc Comprehensive unit tests for the header utility component
tests/tests/TestHeaderCompatibility.cfc Integration tests for backwards compatibility
Comments suppressed due to low confidence (2)

tests/tests/TestCfHeaderUtils.cfc:120

  • The tests don't verify that the correct cfheader attributes are actually used for different CF versions. Consider mocking the cfheader function or capturing the header output to ensure the version detection logic correctly determines which attributes to use.
		// Note: We can't easily test the actual cfheader output in unit tests

core/api.cfc:15

  • The method name 'setStatusHeader' is generic and could conflict with existing methods in subclasses. Consider using a more specific name like 'setTaffyStatusHeader' to avoid potential naming conflicts.
	<cffunction name="setStatusHeader" access="private" output="false" returntype="void" hint="Sets HTTP status header with backwards compatibility">

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants