CF2025: Removing deprecated cfheader StatusText attribute#449
Open
rlorenzo wants to merge 3 commits intoatuttle:mainfrom
Open
CF2025: Removing deprecated cfheader StatusText attribute#449rlorenzo wants to merge 3 commits intoatuttle:mainfrom
rlorenzo wants to merge 3 commits intoatuttle:mainfrom
Conversation
✅ Deploy Preview for taffy-docs canceled.
|
3e540df to
1705875
Compare
Owner
|
Yes, backwards compatibility is still desired. |
* 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
1705875 to
c1d2e7a
Compare
Author
|
@atuttle I added a compatibility layer. The code should work for CF8+. |
There was a problem hiding this comment.
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
cfheadercalls 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">
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Let me know if you wanted to have some backwards compatibility code to still retain StatusText for older versions of ColdFusion.