Package com.atlassian.jira.web.action
Class AjaxHeaders
java.lang.Object
com.atlassian.jira.web.action.AjaxHeaders
Utility class for dealing with AJAX request headers.
- Since:
- v5.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanisPjaxRequest(jakarta.servlet.http.HttpServletRequest request) Returns true if the HTTP request contains the "X-PJAX" header or "X-Requested-With" header with value set to 'XMLHttpRequest'.static booleanrequestUsernameMatches(jakarta.servlet.http.HttpServletRequest request, ApplicationUser user) Checks whether the effective user has change between the time when the view issue page was loaded and the time when the current request was made (this can happen due to session timeouts, logging out in another window, etc).
-
Constructor Details
-
AjaxHeaders
public AjaxHeaders()
-
-
Method Details
-
requestUsernameMatches
public static boolean requestUsernameMatches(jakarta.servlet.http.HttpServletRequest request, ApplicationUser user) Checks whether the effective user has change between the time when the view issue page was loaded and the time when the current request was made (this can happen due to session timeouts, logging out in another window, etc).This method looks at the
"X-AUSERNAME"request header to determine the user that was effective at the time the page was loaded. If the request header is not present, then that is considered a match with anything.- Parameters:
request- a HttpServletRequestuser- a User- Returns:
- true if the request
-
isPjaxRequest
public static boolean isPjaxRequest(jakarta.servlet.http.HttpServletRequest request) Returns true if the HTTP request contains the "X-PJAX" header or "X-Requested-With" header with value set to 'XMLHttpRequest'.- Parameters:
request- a JiraWebActionSupport- Returns:
- a boolean
-