dentarg / hubot-url-title

:crocodile: Returns the title when a link is posted
https://www.npmjs.com/package/hubot-url-title
4 stars 10 forks source link

Enforce a maximum download size #16

Closed pchaigno closed 8 years ago

pchaigno commented 8 years ago

This pull request stops the download and returns an error message if the web resource exceeds the maximum size, arbitrarily set to 1MB. This will effectively stop the download if it's taking too much time. Furthermore, currently, it is possible to exhaust the memory on the system by launching the download of a large file; this pull request prevents it.

However, tests are now taking a lot more time (~24s). We would need a mock to reduce the execution time. I don't think it is a pressing issue right now as few people are developing on this and it is always possible to disable the test temporarily.

dentarg commented 8 years ago

LGTM :) merge at will

dentarg commented 8 years ago

Perhaps https://github.com/carbonfive/nock-vcr could be used for the tests at some point in the future