Commit 22f72ff9 authored by Adam Rice's avatar Adam Rice Committed by Commit Bot

Cancel redirects during preflight

Previously, when a redirect required a CORS preflight, the original
request would be left pending until the preflight finished. Since the
original request couldn't be reused, this tied up a socket
unnecessarily. In extreme cases it could lead to deadlock.

Instead, cancel the original request before issuing the preflight.

BUG=1051357

Change-Id: I3f60a1cbfad2f6b6ff27ccad82b76a08ca747d00
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2079726Reviewed-by: default avatarYutaka Hirano <yhirano@chromium.org>
Commit-Queue: Adam Rice <ricea@chromium.org>
Cr-Commit-Position: refs/heads/master@{#746217}
parent 13ff2f2a
......@@ -484,6 +484,10 @@ void CorsURLLoader::StartRequest() {
return;
}
// Since we're doing a preflight, we won't reuse the original request. Cancel
// it now to free up the socket.
network_loader_.reset();
preflight_controller_->PerformPreflightCheck(
base::BindOnce(&CorsURLLoader::StartNetworkRequest,
weak_factory_.GetWeakPtr()),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment