com.atlassian.jira.web.action
Class SafeRedirectChecker

java.lang.Object
  extended by com.atlassian.jira.web.action.SafeRedirectChecker

public class SafeRedirectChecker
extends Object

Contains methods that check whether a particular redirect is "safe" or not.

Since:
v4.3

Constructor Summary
SafeRedirectChecker(VelocityRequestContextFactory velocityRequestContextFactory)
          Creates a new SafeRedirectChecker
 
Method Summary
 boolean canRedirectTo(String redirectUri)
          Returns a boolean indicating whether redirecting to the given URI is allowed or not.
protected  String getCanonicalBaseURL()
          Returns the canonical base URL for JIRA.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SafeRedirectChecker

public SafeRedirectChecker(VelocityRequestContextFactory velocityRequestContextFactory)
Creates a new SafeRedirectChecker

Parameters:
velocityRequestContextFactory - a VelocityRequestContextFactory
Method Detail

canRedirectTo

public boolean canRedirectTo(String redirectUri)
Returns a boolean indicating whether redirecting to the given URI is allowed or not. This method returns false if the redirectUri is an absolute URI and it points to a domain that is not this JIRA instance's domain, and true otherwise.

Parameters:
redirectUri - a String containing a URI
Returns:
a boolean indicating whether redirecting to the given URI should be allowed or not

getCanonicalBaseURL

protected String getCanonicalBaseURL()
Returns the canonical base URL for JIRA.

Returns:
a String containing the canonical base URL


Copyright © 2002-2012 Atlassian. All Rights Reserved.