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
Do not proceed loading ipfs resources if ipfs is disabled #13989
Conversation
|
/build windows |
|
/build windows |
| @@ -23,6 +23,10 @@ int OnBeforeURLRequest_IPFSRedirectWork( | |||
| return net::OK; | |||
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.
double check the incognito/guest/tor profiles
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.
also having a test would be nice
2ee18c1
to
42e546f
Compare
|
/build windows |
|
/build windows-x86 |
| @@ -19,10 +19,22 @@ namespace ipfs { | |||
| int OnBeforeURLRequest_IPFSRedirectWork( | |||
| const brave::ResponseCallback& next_callback, | |||
| std::shared_ptr<brave::BraveRequestInfo> ctx) { | |||
| if (!ctx->browser_context || !brave::IsRegularProfile(ctx->browser_context)) | |||
| bool hasIpfsScheme = IsIPFSScheme(ctx->request_url); | |||
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.
const bool and has_ipfs_scheme
| bool hasIpfsScheme = IsIPFSScheme(ctx->request_url); | ||
| if (!ctx->browser_context) { | ||
| if (hasIpfsScheme) { | ||
| ctx->blocked_by = brave::kOtherBlocked; |
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.
adding comments is much appreciated
| auto* prefs = user_prefs::UserPrefs::Get(ctx->browser_context); | ||
| if (IsIpfsResolveMethodDisabled(prefs)) { | ||
| bool ipfsDisabled = IsIpfsResolveMethodDisabled(prefs); |
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.
code style
|
maybe @spylogsster wants to take a look |
|
/build linux |
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.
Nice work! LGTM ++
Resolves brave/brave-browser#23646
Submitter Checklist:
QA/YesorQA/No;release-notes/includeorrelease-notes/exclude;OS/...) to the associated issuenpm run test -- brave_browser_tests,npm run test -- brave_unit_tests,npm run lint,npm run gn_check,npm run tslintgit rebase master(if needed)Reviewer Checklist:
gnAfter-merge Checklist:
changes has landed on
Test Plan: