peterbe / premailer

Turns CSS blocks into style attributes
https://premailer.io
BSD 3-Clause "New" or "Revised" License
1.06k stars 188 forks source link

load_external_url should have a proper timeout set #286

Open norbertcyran opened 1 year ago

norbertcyran commented 1 year ago

requests.get which is used by _load_external_url method, by default does not have any timeout set, while it's recommended for nearly all the production code to set some proper value. Currently, it's possible that premailer hangs forever when there are issues with a resource server.

Ref: https://requests.readthedocs.io/en/latest/user/quickstart/#timeouts