Skip to content

Commit

Permalink
Merge branch 'hotfix-10.16.19' into stable
Browse files Browse the repository at this point in the history
  • Loading branch information
DominicWatson committed Mar 22, 2022
2 parents 1fe72f2 + e0ed97d commit 7c3069a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
17 changes: 17 additions & 0 deletions system/coldboxModifications/RequestContextDecorator.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,22 @@ component accessors=true extends="preside.system.coldboxModifications.RequestCon
return currentUrl.left( adminPath.len() ) == adminPath;
}

public string function getApiPath() {
var path = getController().getSetting( "rest.path" );

path = ReReplace( path, "^([^/])", "/\1" );
path = ReReplace( path, "([^/])$", "\1/" );

return path;
}

public boolean function isApiRequest() {
var currentUrl = getCurrentUrl();
var apiPath = getApiPath();

return Left( currentUrl, Len( apiPath ) ) == apiPath;
}

public void function setIsDataManagerRequest() {
getRequestContext().setValue(
name = "_isDataManagerRequest"
Expand Down Expand Up @@ -1023,6 +1039,7 @@ component accessors=true extends="preside.system.coldboxModifications.RequestCon
&& !event.valueExists( "fwreinit" )
&& !this.isBackgroundThread()
&& !this.isAdminRequest()
&& !this.isApiRequest()
&& !this.isAdminUser()
&& event.getHTTPMethod() == "GET"
&& !this.getCurrentUrl().reFindNoCase( "^/asset/" )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ component {
public boolean function isDelayableContext() {
var event = $getRequestContext();

if ( event.isAdminRequest() || event.isEmailRenderingContext() || event.isBackgroundThread() ) {
if ( event.isAdminRequest() || event.isEmailRenderingContext() || event.isBackgroundThread() || event.isApiRequest() ) {
return false;
}

Expand Down

0 comments on commit 7c3069a

Please sign in to comment.