Commit be696555 authored by Takashi Toyoshima's avatar Takashi Toyoshima Committed by Commit Bot

OOR-CORS: fix to finalize preflight request on some errors

Current code does not finalize preflight requests correctly when
the preflight request failed without receiving HTTP response headers.

Bug: 803766
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_mojo
Change-Id: I1c91e3ecf76fdb368e3d55256885f52edf6fcbb3
Reviewed-on: https://chromium-review.googlesource.com/1027556
Commit-Queue: Takashi Toyoshima <toyoshim@chromium.org>
Reviewed-by: default avatarYutaka Hirano <yhirano@chromium.org>
Cr-Commit-Position: refs/heads/master@{#554643}
parent 1f675b46
......@@ -301,11 +301,12 @@ class PreflightController::PreflightLoader final {
}
void HandleResponseBody(std::unique_ptr<std::string> response_body) {
// Reached only when the request fails without receiving headers.
// Reached only when the request fails without receiving headers, e.g.
// unknown hosts, unreachable remote, reset by peer, and so on.
// See https://crbug.com/826868 for related discussion.
DCHECK(!response_body);
// TODO(toyoshim): FinalizeLoader() and RemoveFromController() need to be
// called in this case. Try in the follow-up change.
FinalizeLoader();
RemoveFromController();
}
void FinalizeLoader() {
......
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