You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Task/Issue URL:
https://app.asana.com/0/1200204095367872/1208009677259118/f
### Description
As mentioned in #4871, this
adds some unit tests and cleans up the code in this class to make it a
bit more readable.
### Steps to test this PR
- [x] Visit http://privacy-test-pages.site/
- [x] Go to "Privacy Protections Tests” > “Query parameters"
- [x] Tap on the links
- [x] Verify that the parameters are stripped as expected
Copy file name to clipboardExpand all lines: privacy-config/privacy-config-impl/src/main/java/com/duckduckgo/privacy/config/impl/features/trackingparameters/RealTrackingParameters.kt
+40-16Lines changed: 40 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -62,42 +62,66 @@ class RealTrackingParameters @Inject constructor(
62
62
if (!featureToggle.isFeatureEnabled(PrivacyFeatureName.TrackingParametersFeatureName.value)) returnnull
63
63
if (isAnException(initiatingUrl, url)) returnnull
64
64
65
-
val trackingParameters = trackingParametersRepository.parameters
66
-
67
65
val parsedUri =Uri.parse(url)
66
+
68
67
// In some instances, particularly with ads, the query may represent a different URL (without encoding),
69
68
// making it difficult to detect accurately.
70
69
val query = parsedUri.query
71
70
val queryUri = query?.toUri()
72
-
val uri =if (queryUri?.isValid() ==true) queryUri else parsedUri
Copy file name to clipboardExpand all lines: privacy-config/privacy-config-impl/src/test/java/com/duckduckgo/privacy/config/impl/features/trackingparameters/RealTrackingParametersTest.kt
0 commit comments