Bug
1723518 [wpt PR 29866] - HTTP cache: Fix http-cache.js Header Fields Too Large., a=testonly
Automatic update from web-platform-tests
HTTP cache: Fix http-cache.js Header Fields Too Large. (#29866)
Due to a bug in http-cache.js, sending multiple requests can cause:
```
431 Request Header Fields Too Large
```
That's because the base64 encoded list of requests was added to ... the
list of requests ... iteratively. So the size of request was growing
quadratically relatively to the number of requests.
This has been fixed by copying the list of request instead of taking a
new reference.
Explanation: The code was executing iteratively:
- config = requests[idx];
- fetchInit(requests, config);
- init.headers = config['request_headers'];
- init.headers.push(['Test-Request', btoa(JSON.stringify(requests))]);
which equivalent to:
- requests[idx].requests_headers.push(
['Test-Request'], btoa(JSON.stringify(requests))]),
So we stringify "requests" and append the result into "requests"
iteratively => Boom.
Bug:
1221529
Change-Id: Ib9468d95daca2987dd7c391551387f3107dcb1bc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/
3063967
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Reviewed-by: Maksim Orlovich <morlovich@chromium.org>
Cr-Commit-Position: refs/heads/master@{#908039}
Co-authored-by: Arthur Sonzogni <arthursonzogni@chromium.org>
--
wpt-commits:
34e20f134472dc923d02206fe13819681ca63155
wpt-pr: 29866