Storage quota error isn't raised when putting empty response into CacheStorage |
|||
Issue description
Chrome Version : 66.0.3359.139
OS Version: OS X 10.13.4
What steps will reproduce the problem?
1. Fill up quota with dummy data
2. Put empty response data in the cache, it will succeed:
> await caches.open('test').then((c) => c.put('/test', new Response()));
> undefined
3. Put 1-byte response in the cache, it will fail
> await caches.open('test').then((c) => c.put('/test', new Response('a')));
> Uncaught (in promise) DOMException: Quota exceeded.
What is the expected result?
Quota exceeded error with the empty response object.
What happens instead of that?
I can write data in excess of the storage quota. Seems like I can write arbitrarily as much data as I want.
UserAgentString: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.139 Safari/537.36
,
May 10 2018
Thanks for filing the issue! @Reporter: As we are not very clear about the steps to be performed in comment#0(i.e., where to fill up quota with dummy data...), Could you please share any sample test file/URL which helps us to triage the issue in a better way. Any further inputs from your end may be helpful.
,
May 11 2018
Removing "Needs-Feedback" label since I'm in touch with the reporter. Sounds like we're not including header size in the byte delta: https://cs.chromium.org/chromium/src/content/browser/cache_storage/cache_storage_cache.cc?q=quota_manager+file:%5Esrc/content/browser/cache_storage/+package:%5Echromium$&dr=C&l=534 We could either compute the header size or use a conservative fixed value (e.g. 2kB) |
|||
►
Sign in to add a comment |
|||
Comment 1 by krajshree@chromium.org
, May 10 2018