httpcoldfusioncoldfusion-7

Is it possible to preserve the case of an HTTP GET request in ColdFusion MX 7?


Is it possible to preserve the case of the GET field names in ColdFusion MX 7 (the case is preserved in CF9)? I've searched tirelessly for an answer but all solutions seem to be POST specific, whereas this is a GET.

N.B. I am aware that RFC2616 states that HTTP field names are case-insensitive, but we're all aware how easy specifications can be deviated from...

EXAMPLE:

Given the following ColdFusion script (let's call it 'url-case-test.cfm'):

<html>
    <body>
        <cfoutput>
            #structKeyList(url)#
        </cfoutput>
    </body>
</html>

And navigating to this script using the following parameter decorated URL:

http://localhost:8080/cfusion/url-case-test.cfm?name1=value1&name2=value2&name3=value3

I get the output:

NAME1,NAME2,NAME3

Any suggestions on how I preserve the case? Help would be greatly appreciated.


Solution

  • Another option is using getParameterMap() which returns a case-sensitive structure of parameters.

    <cfset map = getPageContext().getRequest().getParameterMap()>
    <cfoutput>#structKeyList(map)#</cfoutput>