ngx-redi-core 0.0.2 → 0.0.4
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/package.json
CHANGED
|
@@ -60,13 +60,16 @@ export class SecureInterceptor implements HttpInterceptor {
|
|
|
60
60
|
*/
|
|
61
61
|
private cifrarRequest(request: HttpRequest<any>): HttpRequest<any> {
|
|
62
62
|
let newRequest: HttpRequest<any> = request;
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
63
|
+
let requestDefinition = request.context.get(REQUEST_TOKEN);
|
|
64
|
+
if (requestDefinition) {
|
|
65
|
+
switch (request.method) {
|
|
66
|
+
case 'POST':
|
|
67
|
+
newRequest = request.clone({ body: this.cifrarDatos(request.body) });
|
|
68
|
+
break;
|
|
69
|
+
default:
|
|
70
|
+
newRequest = request.clone({ url: this.cifrarPeticionUrl(request) });
|
|
71
|
+
break;
|
|
72
|
+
}
|
|
70
73
|
}
|
|
71
74
|
return newRequest;
|
|
72
75
|
}
|
|
@@ -79,7 +82,7 @@ export class SecureInterceptor implements HttpInterceptor {
|
|
|
79
82
|
private cifrarPeticionUrl(request: HttpRequest<any>): string {
|
|
80
83
|
let requestData = request.context.get(REQUEST_TOKEN);
|
|
81
84
|
let queryParams: string[] = [];
|
|
82
|
-
let queryObject = Object.fromEntries(new URL(request.url).searchParams
|
|
85
|
+
let queryObject = Object.fromEntries(new URL(request.url).searchParams);
|
|
83
86
|
if (typeof requestData === 'object') {
|
|
84
87
|
Object.entries(queryObject).forEach(([key, value]) => {
|
|
85
88
|
if (!requestData[key]) {
|