From 60c65f2110f65221bc3a71b2887667e78c53c53e Mon Sep 17 00:00:00 2001
From: rsanchez <rsanchez@curisit.net>
Date: Wed, 22 Mar 2017 17:44:16 +0000
Subject: [PATCH] #3527 fix - Added pack/license actions and a lot of bugfixing
---
securis/src/main/webapp/src/app/common/default.requests.options.ts | 11 +++++------
1 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/securis/src/main/webapp/src/app/common/default.requests.options.ts b/securis/src/main/webapp/src/app/common/default.requests.options.ts
index 5b3cba2..ce35fb0 100644
--- a/securis/src/main/webapp/src/app/common/default.requests.options.ts
+++ b/securis/src/main/webapp/src/app/common/default.requests.options.ts
@@ -23,11 +23,6 @@
// Set the default 'Content-Type' header
this.headers.set('Content-Type', 'application/json');
- let token = this.store.get<string>('token');
- if (token) {
- this.headers.set('X-SECURIS-TOKEN', token);
-
- }
}
}
@@ -35,11 +30,15 @@
@Injectable()
export class ApiXHRBackend extends XHRBackend {
- constructor(_browserXHR: BrowserXhr, _baseResponseOptions: ResponseOptions, _xsrfStrategy: XSRFStrategy) {
+ constructor(_browserXHR: BrowserXhr, _baseResponseOptions: ResponseOptions, _xsrfStrategy: XSRFStrategy, private store: LocalStorageService) {
super(_browserXHR, _baseResponseOptions, _xsrfStrategy);
}
createConnection(request: Request): XHRConnection {
+ let token = this.store.get<string>('token');
+ if (token) {
+ request.headers.set('X-SECURIS-TOKEN', token);
+ }
if (!request.url.endsWith('.js') && !request.url.endsWith('.json') && !request.url.endsWith('.html') && !request.url.endsWith('.svg')){
request.url = 'http://localhost:8080/securis/' + request.url; // prefix base url
}
--
Gitblit v1.3.2