Skip to content
Open
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
18 changes: 14 additions & 4 deletions core/src/org/labkey/core/CoreController.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@
import org.labkey.api.action.ExportAction;
import org.labkey.api.action.MutatingApiAction;
import org.labkey.api.action.ReadOnlyApiAction;
import org.labkey.api.action.ReturnUrlForm;
import org.labkey.api.action.SimpleApiJsonForm;
import org.labkey.api.action.SimpleRedirectAction;
import org.labkey.api.action.SimpleViewAction;
import org.labkey.api.action.SpringActionController;
import org.labkey.api.admin.AbstractFolderContext.ExportType;
Expand Down Expand Up @@ -204,10 +206,6 @@

import static org.labkey.api.view.template.WarningService.SESSION_WARNINGS_BANNER_KEY;

/**
* User: jeckels
* Date: Jan 4, 2007
*/
public class CoreController extends SpringActionController
{
private static final Map<Container, Content> _customStylesheetCache = new ConcurrentHashMap<>();
Expand Down Expand Up @@ -2908,4 +2906,16 @@ public void setProvider(String provider)

}

// Called by various client components to ensure safe redirects, GitHub Issue #1023. This action redirects to
// local URLs only, never to an external site, even if the host is on the "Allowed External Redirect Hosts" list.
@SuppressWarnings("unused")
@RequiresNoPermission
public static class SafeRedirectAction extends SimpleRedirectAction<ReturnUrlForm>
{
@Override
public ActionURL getRedirectURL(ReturnUrlForm form) throws Exception
{
return form.getReturnActionURL(AppProps.getInstance().getHomePageActionURL());
}
}
}