-
Notifications
You must be signed in to change notification settings - Fork 116
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
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for taffy-docs canceled.
|
3e540df
to
1705875
Compare
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
@atuttle I added a compatibility layer. The code should work for CF8+. |
There was a problem hiding this 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">
Let me know if you wanted to have some backwards compatibility code to still retain StatusText for older versions of ColdFusion.