Title:
CFHTTP Illegal Argument: Illegal character in query at index X in CFHTTPPARAM
| View in TrackerStatus/Resolution/Reason: Closed/Fixed/
Reporter/Name(from Bugbase): Tom Lofts / Tom Lofts (Tom Lofts)
Created: 04/28/2015
Components: Net Protocols, HTTP
Versions: 11.0
Failure Type: Incorrect w/Workaround
Found In Build/Fixed In Build: CF11_Final /
Priority/Frequency: Minor / Few users will encounter
Locale/System: ALL / Win 2012 Server x64
Vote Count: 0
Problem Description:
We have discovered a bug as part of an application migration from CF8 to CF11. In CF8 the 'name' attribute in the CFHTTPPARAM tag may contain special characters (e.g. "|") which are URL encoded when sent to the server when type='url' is used.
In CF11 this is no longer the case, and using special characters in the name attribute results in the following error CFHTTP Illegal Argument: Illegal character in query at index X.
Steps to Reproduce:
<cfhttp url="http://www.example.com">
<cfhttpparam type="url" name="|" value="">
</cfhttp>
<cfdump var="#cfhttp#">
Actual Result:
Charset [empty string]
ErrorDetail Illegal Argument: Illegal character in query at index 23: http://www.example.com?|=
Filecontent Connection Failure
Header [empty string]
Mimetype Unable to determine MIME type of file.
Responseheader
struct [empty]
Statuscode Connection Failure. Status code unavailable.
Text YES
Expected Result:
A standard CFHTTP structure with a 200 Statuscode
Any Workarounds:
It's possible to use URLEncodeFormat to encode the name attribute to work around the issue:
<cfhttp url="http://www.example.com">
<cfhttpparam type="url" name="#URLEncodedFormat("|")#" value="">
</cfhttp>
<cfdump var="#cfhttp#">
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 3977514
External Customer Info:
External Company:
External Customer Name: Tom
External Customer Email:
External Test Config: My Hardware and Environment details:
Attachments:
Comments: