-
Notifications
You must be signed in to change notification settings - Fork 918
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Intercept requests and add skeleton for malicious site detection #5369
base: develop
Are you sure you want to change the base?
Intercept requests and add skeleton for malicious site detection #5369
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
} | ||
|
||
@Test | ||
fun `shouldOverride returns true when feature is enabled, is malicious, and not mainframe nor iframe`() = runTest { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test name appears to be incorrect - it states "returns true" but the test asserts false
. Consider renaming to shouldOverride returns false when feature is enabled, is malicious, and not mainframe nor iframe
to accurately reflect the expected behavior being tested.
Spotted by Graphite Reviewer
Is this helpful? React 👍 or 👎 to let us know.
13cfb3a
to
8d0f3b0
Compare
8d0f3b0
to
0b7f33d
Compare
return WebResourceResponse(null, null, null) | ||
} | ||
processedUrls.add(decodedUrl) | ||
} else if (isForIframe(request) && documentUri?.host == request.requestHeaders["Referer"]?.toUri()?.host) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The toUri()
call on the Referer
header value needs null-safety and exception handling. A malformed URI in the header could crash the app. Consider wrapping this in a try-catch block and providing a fallback value when the URI is invalid or malformed.
Spotted by Graphite Reviewer
Is this helpful? React 👍 or 👎 to let us know.
Task/Issue URL: https://app.asana.com/0/1205008441501016/1207151848931035/f
Description
Steps to test this PR
Feature 1
Timber.tag("MaliciousSiteProtection").d("isMalicious $url")
for all mainframe and iframe requests (only for internal builds).UI changes