Skip to content

Commit 8444d8e

Browse files
committed
let's just use "null" for better old-version support
1 parent 00dbc65 commit 8444d8e

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

core/api.cfc

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -726,11 +726,11 @@
726726

727727
<!--- Check for method tunnelling by clients unable to send PUT/DELETE requests (e.g. Flash Player);
728728
Actual desired method will be contained in a special header --->
729-
<cfset var httpMethodOverride = null />
730-
<cftry>
731-
<cfset httpMethodOverride = GetPageContext().getRequest().getHeader("X-HTTP-Method-Override") />
732-
<cfcatch type="any"></cfcatch>
733-
</cftry>
729+
<cfset var httpMethodOverride = "null" />
730+
<cftry>
731+
<cfset httpMethodOverride = GetPageContext().getRequest().getHeader("X-HTTP-Method-Override") />
732+
<cfcatch type="any"></cfcatch>
733+
</cftry>
734734

735735
<cfset requestObj.uri = getPath() />
736736
<cfif NOT len(requestObj.uri)>
@@ -742,8 +742,8 @@
742742
</cfif>
743743
</cfif>
744744

745-
<!--- check for format in the URI --->
746-
<cfset requestObj.uriFormat = formatFromURI(requestObj.uri) />
745+
<!--- check for format in the URI --->
746+
<cfset requestObj.uriFormat = formatFromURI(requestObj.uri) />
747747

748748
<!--- attempt to find the cfc for the requested uri --->
749749
<cfset requestObj.matchingRegex = matchURI(requestObj.uri) />
@@ -760,8 +760,8 @@
760760
<cfset requestObj.verb = cgi.request_method />
761761

762762
<!--- Should we override the actual method based on method tunnelling? --->
763-
<cfif isDefined("httpMethodOverride") AND not isNull(httpMethodOverride)>
764-
<cfset requestObj.verb = httpMethodOverride />
763+
<cfif isDefined("httpMethodOverride") AND not httpMethodOverride eq "null">
764+
<cfset requestObj.verb = httpMethodOverride />
765765
</cfif>
766766

767767
<cfif structKeyExists(application._taffy.endpoints[requestObj.matchingRegex].methods, requestObj.verb)>

0 commit comments

Comments
 (0)