mirror of https://github.com/apache/nifi.git
NIFI-10196 Corrected Jolt UI CSRF Header Handling
Signed-off-by: Matthew Burgess <mattyb149@apache.org> This closes #6198
This commit is contained in:
parent
4c0555a476
commit
0dea0ae364
|
@ -19,11 +19,9 @@
|
||||||
|
|
||||||
var AppRun = function($rootScope,$state,$http){
|
var AppRun = function($rootScope,$state,$http){
|
||||||
|
|
||||||
// Get the Request Token for CSRF mitigation and send on all requests
|
// Set CSRF Cookie and Header names to match Spring Security configuration in StandardCookieCsrfTokenRepository
|
||||||
if (nf.AuthorizationStorage.hasToken()) {
|
$http.defaults.xsrfCookieName = '__Secure-Request-Token';
|
||||||
var token = nf.AuthorizationStorage.getRequestToken();
|
$http.defaults.xsrfHeaderName = 'Request-Token';
|
||||||
$http.defaults.headers.common['Request-Token'] = token;
|
|
||||||
}
|
|
||||||
|
|
||||||
$rootScope.$on('$stateChangeError', function(event, toState, toParams, fromState, fromParams, error){
|
$rootScope.$on('$stateChangeError', function(event, toState, toParams, fromState, fromParams, error){
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
|
Loading…
Reference in New Issue