Skip to content

Commit

Permalink
Set load flags to prevent reading from HTTP cache
Browse files Browse the repository at this point in the history
  • Loading branch information
yachtcaptain23 committed Apr 14, 2021
1 parent 4cfe17f commit d7f06b0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions components/brave_rewards/browser/rewards_service_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include "brave/components/brave_rewards/browser/rewards_service_impl.h"

#include <stdint.h>
#include <string>

#include <algorithm>
#include <functional>
Expand Down Expand Up @@ -981,6 +982,7 @@ void RewardsServiceImpl::LoadURL(
auto net_request = std::make_unique<network::ResourceRequest>();
net_request->url = parsed_url;
net_request->method = URLMethodToRequestType(request->method);
net_request->load_flags = request->load_flags;

// Loading Twitter requires credentials
if (net_request->url.DomainIs("twitter.com")) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,7 @@ struct UrlRequest {
string content;
string content_type;
bool skip_log;
uint32 load_flags = 0;
};

struct UrlResponse {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include "bat/ledger/internal/ledger_impl.h"
#include "bat/ledger/internal/publisher/protos/channel_response.pb.h"
#include "brave/components/brave_private_cdn/private_cdn_helper.h"
#include "net/base/load_flags.h"
#include "net/http/http_status_code.h"

using std::placeholders::_1;
Expand Down Expand Up @@ -219,6 +220,7 @@ void GetPublisher::Request(

auto request = type::UrlRequest::New();
request->url = GetUrl(hash_prefix);
request->load_flags = net::LOAD_BYPASS_CACHE | net::LOAD_DISABLE_CACHE;
ledger_->LoadURL(std::move(request), url_callback);
}

Expand Down

0 comments on commit d7f06b0

Please sign in to comment.