mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04: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 * Update api-session-spec.js * chore: fixup test as per original PR to master
This commit is contained in:
@@ -281,6 +281,7 @@ bool URLRequestNS::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(
|
||||
&URLRequestNS::OnResponseStarted, weak_factory_.GetWeakPtr()));
|
||||
loader_->SetOnRedirectCallback(
|
||||
|
||||
Reference in New Issue
Block a user