Commit ec47130f authored by Benoit Lize's avatar Benoit Lize Committed by Commit Bot

[customtabs] Increase max response size of DetachedResourceRequest.

Some misconfigured servers redirect to a 200 code instead of a 204,
meaning that the response payload can be quite large. This is not an
issue in practice, but it does confuse metrics a bit. Since there is no
harm in increasing the limit, do it to make metrics easier to
understand.

Bug: 816837
Change-Id: I908a3cad22779b57bdb78f5957e8839048ee3597
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2339981Reviewed-by: default avatarPeter Conn <peconn@chromium.org>
Commit-Queue: Benoit L <lizeb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#795533}
parent 06b5dabe
......@@ -39,7 +39,7 @@ namespace customtabs {
// This is a UI thread class.
class DetachedResourceRequest {
public:
static constexpr int kMaxResponseSize = 100 * 1024;
static constexpr int kMaxResponseSize = 500 * 1024;
// The motivation of the resource request, used for histograms reporting.
// GENERATED_JAVA_ENUM_PACKAGE: org.chromium.chrome.browser.customtabs
......
......@@ -143,9 +143,8 @@ std::unique_ptr<HttpResponse> LargeHeadersAndResponseSize(
return nullptr;
auto response = std::make_unique<net::test_server::BasicHttpResponse>();
response->AddCustomHeader(
"X-Large-Header",
std::string(DetachedResourceRequest::kMaxResponseSize, 'b'));
// Maximum header size ios 256kB, stay below it.
response->AddCustomHeader("X-Large-Header", std::string(100 * 1024, 'b'));
response->set_code(net::HTTP_OK);
uint32_t length;
......@@ -163,9 +162,8 @@ std::unique_ptr<HttpResponse> LargeResponseAndCookie(
auto response = std::make_unique<net::test_server::BasicHttpResponse>();
response->AddCustomHeader("Set-Cookie", kCookieFromLargeResponse);
response->AddCustomHeader(
"X-Large-Header",
std::string(DetachedResourceRequest::kMaxResponseSize, 'b'));
// Maximum header size ios 256kB, stay below it.
response->AddCustomHeader("X-Large-Header", std::string(100 * 1024, 'b'));
response->set_code(net::HTTP_OK);
response->set_content(
std::string(DetachedResourceRequest::kMaxResponseSize + 1, 'a'));
......
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