mirror of
https://github.com/electron/electron.git
synced 2026-01-27 16:28:23 -05:00
fix: allow reading body from non-2xx responses in net.request (#21055)
* fix(urlrequest): allow non-2xx repsponse results - closes #21046 * test(net): add test cases to verify non-2xx body * test(session): update spec to match clientrequest behavior * test(net): update test cases to match clientrequest behavior * spec: clean up async net spec
This commit is contained in:
@@ -286,6 +286,8 @@ bool URLRequest::Write(v8::Local<v8::Value> data, bool is_last) {
|
||||
network::ResourceRequest* request_ref = request_.get();
|
||||
loader_ = network::SimpleURLLoader::Create(std::move(request_),
|
||||
kTrafficAnnotation);
|
||||
|
||||
loader_->SetAllowHttpErrorResults(true);
|
||||
loader_->SetOnResponseStartedCallback(
|
||||
base::Bind(&URLRequest::OnResponseStarted, weak_factory_.GetWeakPtr()));
|
||||
loader_->SetOnRedirectCallback(
|
||||
|
||||
Reference in New Issue
Block a user