@smartbit4all/ng-client 1.1.27 → 1.1.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2020/lib/session/smart-header-maintainer.interceptor.mjs +14 -11
- package/fesm2015/smartbit4all-ng-client.mjs +12 -9
- package/fesm2015/smartbit4all-ng-client.mjs.map +1 -1
- package/fesm2020/smartbit4all-ng-client.mjs +12 -9
- package/fesm2020/smartbit4all-ng-client.mjs.map +1 -1
- package/lib/session/smart-header-maintainer.interceptor.d.ts +3 -3
- package/package.json +1 -1
- package/smartbit4all-ng-client-1.1.28.tgz +0 -0
- package/smartbit4all-ng-client-1.1.27.tgz +0 -0
|
@@ -3108,21 +3108,24 @@ class SmartHeaderMaintainerInterceptor {
|
|
|
3108
3108
|
this.session = session;
|
|
3109
3109
|
}
|
|
3110
3110
|
intercept(request, next) {
|
|
3111
|
-
|
|
3111
|
+
// new request data
|
|
3112
|
+
let url = request.urlWithParams.replace('http://localhost', this.session.getBasePath());
|
|
3112
3113
|
let headers = {};
|
|
3114
|
+
// copy current headers
|
|
3115
|
+
request.headers.keys().map((key) => {
|
|
3116
|
+
let value = request.headers.getAll(key);
|
|
3117
|
+
if (value) {
|
|
3118
|
+
headers[key] = value;
|
|
3119
|
+
}
|
|
3120
|
+
});
|
|
3121
|
+
// add own headers
|
|
3122
|
+
const hasHeaders = this.session.headerParams && this.session.headerParams.length;
|
|
3113
3123
|
if (hasHeaders) {
|
|
3114
3124
|
this.session.headerParams.map((headerParam) => {
|
|
3115
3125
|
headers[headerParam.headerName] = headerParam.value;
|
|
3116
3126
|
});
|
|
3117
3127
|
}
|
|
3118
|
-
|
|
3119
|
-
// TODO fix me
|
|
3120
|
-
if (request.urlWithParams.includes("/kerb/sso")) {
|
|
3121
|
-
request = request.clone({
|
|
3122
|
-
url: url,
|
|
3123
|
-
});
|
|
3124
|
-
return next.handle(request);
|
|
3125
|
-
}
|
|
3128
|
+
// create new request (necessary to rewrite url)
|
|
3126
3129
|
request = request.clone({
|
|
3127
3130
|
url: url,
|
|
3128
3131
|
setHeaders: headers,
|