Skip to content
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

Issue 3920: Proxy requests for resources from storage.googleapis.com through the crlset redirector #2114

Merged
merged 1 commit into from
Apr 1, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ int OnBeforeURLRequest_StaticRedirectWork(
URLPattern::SCHEME_HTTP | URLPattern::SCHEME_HTTPS, kCRLSetPrefix2);
static URLPattern crlSet_pattern3(
URLPattern::SCHEME_HTTP | URLPattern::SCHEME_HTTPS, kCRLSetPrefix3);
static URLPattern crlSet_pattern4(
URLPattern::SCHEME_HTTP | URLPattern::SCHEME_HTTPS, kCRLSetPrefix4);
static URLPattern crxDownload_pattern(
URLPattern::SCHEME_HTTP | URLPattern::SCHEME_HTTPS, kCRXDownloadPrefix);

Expand Down Expand Up @@ -68,6 +70,13 @@ int OnBeforeURLRequest_StaticRedirectWork(
return net::OK;
}

if (crlSet_pattern4.MatchesURL(ctx->request_url)) {
replacements.SetSchemeStr("https");
replacements.SetHostStr("crlsets.brave.com");
ctx->new_url_spec = ctx->request_url.ReplaceComponents(replacements).spec();
return net::OK;
}

#if !defined(NDEBUG)
GURL gurl = ctx->request_url;
static std::vector<URLPattern> allowed_patterns({
Expand Down
3 changes: 3 additions & 0 deletions common/network_constants.cc
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ const char kCRLSetPrefix2[] =
"*://*.gvt1.com/edgedl/release2/chrome_component/*crl-set*";
const char kCRLSetPrefix3[] =
"*://www.google.com/dl/release2/chrome_component/*crl-set*";
const char kCRLSetPrefix4[] =
"*://storage.googleapis.com/update-delta/hfnkpimlhhgieaddgfemjhofmfblmnib"
"/*crxd";
const char kGoogleTagManagerPattern[] =
"https://www.googletagmanager.com/gtm.js";
const char kGoogleTagServicesPattern[] =
Expand Down
1 change: 1 addition & 0 deletions common/network_constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ extern const char kSafeBrowsingPrefix[];
extern const char kCRLSetPrefix1[];
extern const char kCRLSetPrefix2[];
extern const char kCRLSetPrefix3[];
extern const char kCRLSetPrefix4[];
extern const char kTwitterPattern[];
extern const char kTwitterReferrer[];
extern const char kTwitterRedirectURL[];
Expand Down