Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions core/api.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,11 @@

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

<cfset requestObj.uri = getPath() />
<cfif NOT len(requestObj.uri)>
Expand All @@ -738,8 +742,8 @@
</cfif>
</cfif>

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

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

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

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