Merge pull request #185 from deepak1556/devtools_network_transaction_patch
devtools: exclude devtools related http header from serviceworker context
This commit is contained in:
commit
395a2eb1cc
3 changed files with 11 additions and 6 deletions
|
@ -15,13 +15,11 @@
|
|||
|
||||
namespace brightray {
|
||||
|
||||
namespace {
|
||||
|
||||
const char kDevToolsEmulateNetworkConditionsClientId[] =
|
||||
// static
|
||||
const char
|
||||
DevToolsNetworkTransaction::kDevToolsEmulateNetworkConditionsClientId[] =
|
||||
"X-DevTools-Emulate-Network-Conditions-Client-Id";
|
||||
|
||||
} // namespace
|
||||
|
||||
DevToolsNetworkTransaction::DevToolsNetworkTransaction(
|
||||
DevToolsNetworkController* controller,
|
||||
scoped_ptr<net::HttpTransaction> transaction)
|
||||
|
|
|
@ -22,6 +22,8 @@ class DevToolsNetworkInterceptor;
|
|||
|
||||
class DevToolsNetworkTransaction : public net::HttpTransaction {
|
||||
public:
|
||||
static const char kDevToolsEmulateNetworkConditionsClientId[];
|
||||
|
||||
DevToolsNetworkTransaction(
|
||||
DevToolsNetworkController* controller,
|
||||
scoped_ptr<net::HttpTransaction> network_transaction);
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
#include "browser/net/devtools_network_controller.h"
|
||||
#include "browser/net/devtools_network_transaction.h"
|
||||
|
||||
#include "content/public/browser/service_worker_context.h"
|
||||
#include "net/base/net_errors.h"
|
||||
#include "net/http/http_network_layer.h"
|
||||
#include "net/http/http_network_transaction.h"
|
||||
|
@ -18,6 +19,10 @@ DevToolsNetworkTransactionFactory::DevToolsNetworkTransactionFactory(
|
|||
net::HttpNetworkSession* session)
|
||||
: controller_(controller),
|
||||
network_layer_(new net::HttpNetworkLayer(session)) {
|
||||
std::set<std::string> headers;
|
||||
headers.insert(
|
||||
DevToolsNetworkTransaction::kDevToolsEmulateNetworkConditionsClientId);
|
||||
content::ServiceWorkerContext::AddExcludedHeadersForFetchEvent(headers);
|
||||
}
|
||||
|
||||
DevToolsNetworkTransactionFactory::~DevToolsNetworkTransactionFactory() {
|
||||
|
|
Loading…
Reference in a new issue