Skip to content

Commit

Permalink
Improve redacting
Browse files Browse the repository at this point in the history
  • Loading branch information
mateuuszzzzz committed Sep 4, 2024
1 parent 6ecbb5e commit 1aab4f0
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions patches/react-native+0.75.2+016+hybrid-app.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
diff --git a/node_modules/react-native/.gradle/buildOutputCleanup/buildOutputCleanup.lock b/node_modules/react-native/.gradle/buildOutputCleanup/buildOutputCleanup.lock
new file mode 100644
index 0000000..a403fbb
Binary files /dev/null and b/node_modules/react-native/.gradle/buildOutputCleanup/buildOutputCleanup.lock differ
index 0000000..e69de29
diff --git a/node_modules/react-native/.gradle/buildOutputCleanup/cache.properties b/node_modules/react-native/.gradle/buildOutputCleanup/cache.properties
new file mode 100644
index 0000000..17fb517
Expand Down Expand Up @@ -45,10 +44,10 @@ index 0000000..dacc2de
+ </filteredResources>
+</projectDescription>
diff --git a/node_modules/react-native/Libraries/ReactNative/AppRegistry.js b/node_modules/react-native/Libraries/ReactNative/AppRegistry.js
index 68bd389..4d1925e 100644
index 68bd389..f99894d 100644
--- a/node_modules/react-native/Libraries/ReactNative/AppRegistry.js
+++ b/node_modules/react-native/Libraries/ReactNative/AppRegistry.js
@@ -232,12 +232,31 @@ const AppRegistry = {
@@ -232,12 +232,34 @@ const AppRegistry = {
appParameters: Object,
displayMode?: number,
): void {
Expand All @@ -67,7 +66,10 @@ index 68bd389..4d1925e 100644
+ return parameters;
+ }
+
+ const redactedSearchParams = [...new URLSearchParams(queryString).entries()].map(([key, value]) => `${key}=${sensitiveParams.includes(key) ? '<REDACTED>' : value}`);
+ const redactedSearchParams = queryString.split('&').map((param) => {
+ const [key, value] = param.split('=');
+ return `${key}=${sensitiveParams.includes(key) ? '<REDACTED>' : value}`
+ });
+ return {...parameters, initialProps: {...initialProps, url: `${urlBase}?${redactedSearchParams.join('&')}`}};
+ }
+
Expand Down

0 comments on commit 1aab4f0

Please sign in to comment.