Commit 4f17212c authored by Marijn Kruisselbrink's avatar Marijn Kruisselbrink Committed by Commit Bot

[AppCache] Treat non-200 2xx responses for manifests as SERVER_ERROR.

We were already treating these responses as errors, but were using
UPDATE_OK as "ResultType" when handling the error. This fixes that
to treat these errors the same as any other non-200 server response.

Bug: 923650
Change-Id: I5f3464bd5ae8dc940f1476297cd935f9ecb5998e
Reviewed-on: https://chromium-review.googlesource.com/c/1457469
Commit-Queue: Marijn Kruisselbrink <mek@chromium.org>
Commit-Queue: Victor Costan <pwnall@chromium.org>
Auto-Submit: Marijn Kruisselbrink <mek@chromium.org>
Reviewed-by: default avatarVictor Costan <pwnall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#629869}
parent 4f23c298
......@@ -729,12 +729,18 @@ void AppCacheUpdateJob::HandleManifestRefetchCompleted(URLFetcher* fetcher,
const char kFormatString[] = "Manifest re-fetch failed (%d) %s";
std::string message = FormatUrlErrorMessage(
kFormatString, manifest_url_, fetcher->result(), response_code);
ResultType result = fetcher->result();
if (result == UPDATE_OK) {
// URLFetcher considers any 2xx response a success, however in this
// particular case we want to treat any non 200 responses as failures.
result = SERVER_ERROR;
}
HandleCacheFailure(
blink::mojom::AppCacheErrorDetails(
message,
blink::mojom::AppCacheErrorReason::APPCACHE_MANIFEST_ERROR,
GURL(), response_code, false /*is_cross_origin*/),
fetcher->result(), GURL());
result, GURL());
}
}
}
......
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