Skip to content
Open
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public class ApiHandler
{
private static final Pattern URL_PATTERN = Pattern.compile( "^/api$" );

private static final ApplicationKey WELCOME_APP_KEY = ApplicationKey.from( "com.enonic.xp.app.welcome" );
private static final ApplicationKey SDK_APP_KEY = ApplicationKey.from( "com.enonic.xp.sdk" );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
private static final ApplicationKey SDK_APP_KEY = ApplicationKey.from( "com.enonic.xp.sdk" );
private static final ApplicationKey SDK_APP_KEY = ApplicationKey.from( "com.enonic.xp.app.sdk" );


private final ApplicationService applicationService;

Expand Down Expand Up @@ -70,7 +70,7 @@ public void activate( final ApiConfig config )
@Override
protected boolean canHandle( final WebRequest webRequest )
{
boolean isSDK = applicationService.get( WELCOME_APP_KEY ) != null;
boolean isSDK = applicationService.get( SDK_APP_KEY ) != null;
boolean isIndexEnabled = isSDK || RunMode.get() == RunMode.DEV
? apiIndexMode == ApiIndexMode.ON || apiIndexMode == ApiIndexMode.AUTO
: apiIndexMode == ApiIndexMode.ON;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public void testCanHandle()
assertFalse( this.handler.canHandle( webRequest ) );

Application welcomeApp = mock( Application.class );
when( applicationService.get( ApplicationKey.from( "com.enonic.xp.app.welcome" ) ) ).thenReturn( welcomeApp );
when( applicationService.get( ApplicationKey.from( "com.enonic.xp.sdk" ) ) ).thenReturn( welcomeApp );
when( apiConfig.api_index_enabled() ).thenReturn( "on" );
assertTrue( this.handler.canHandle( webRequest ) );
}
Expand Down