feat: add support for net requests to use the session cookie store (#22704)

This commit is contained in:
Samuel Attard 2020-03-20 15:56:02 -07:00 committed by GitHub
parent 07a049ef1b
commit 60bd52880f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 137 additions and 1 deletions

View file

@ -17,6 +17,7 @@
#include "gin/wrappable.h"
#include "mojo/public/cpp/bindings/remote.h"
#include "mojo/public/cpp/system/data_pipe_producer.h"
#include "net/base/load_flags.h"
#include "services/network/public/cpp/resource_request.h"
#include "services/network/public/cpp/simple_url_loader.h"
#include "services/network/public/mojom/chunked_data_pipe_getter.mojom.h"
@ -358,6 +359,12 @@ gin_helper::WrappableBase* SimpleURLLoaderWrapper::New(gin::Arguments* args) {
}
}
bool use_session_cookies = false;
opts.Get("useSessionCookies", &use_session_cookies);
if (!use_session_cookies) {
request->load_flags |= net::LOAD_DO_NOT_SEND_COOKIES;
}
// Chromium filters headers using browser rules, while for net module we have
// every header passed.
request->report_raw_headers = true;