# Limiting download size with net::http

**URL:** <https://www.ruby-forum.com/t/limiting-download-size-with-net-http/190552>\
**Category:** Ruby\
**Created:** [June 22, 2010, 6:07pm UTC](https://www.ruby-forum.com/t/limiting-download-size-with-net-http/190552 "2010-06-22T18:07:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bouldr-matt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/85e7bf/32.png) [@bouldr-matt](https://www.ruby-forum.com/u/bouldr-matt)\
**Post date:** [June 22, 2010, 6:07pm UTC](https://www.ruby-forum.com/t/limiting-download-size-with-net-http/190552/1 "2010-06-22T18:07:54Z")

</div>

Hi list,

I got bored so I’m writing a little web spider in ruby. I’ve got several  
features  
planned like content type limits etc, but I’m stuck with the size limit.

If I check against content\_length from the headers of the response  
object, it’s  
already downloaded the body. How can I check and exclude based on the  
content\_length  
before the whole body is downloaded?

Thanks
