ChromeDevTools / devtools-protocol

Chrome DevTools Protocol
https://chromedevtools.github.io/devtools-protocol/
BSD 3-Clause "New" or "Revised" License
1.15k stars 226 forks source link

Network.getResponseBody size limit #259

Closed kubakista closed 2 years ago

kubakista commented 2 years ago

Hello,

If I have a request ID and need to get response body, I can use the following method. https://chromedevtools.github.io/devtools-protocol/1-3/Network/#method-getResponseBody

I am curious whether there is an option to define/limit how big data to download. For example, I do not want to download data bigger than 10 MB. Is there any kind of setting to define this?

I was thinking about using content-length header, but the header does not have to be returned at all.

Thank you.

kubakista commented 2 years ago

I was able to resolve it by using dataLength from dataReceived event. https://stackoverflow.com/questions/48263345/how-can-i-get-the-raw-download-size-of-a-request-using-puppeteer