From 3235a00f09831c9e4da96d8edbbcb2687454bdf7 Mon Sep 17 00:00:00 2001 From: Florent Date: Thu, 8 May 2014 12:20:45 +0200 Subject: [PATCH] Be sure to download a pdf --- modules/ing/backend.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/ing/backend.py b/modules/ing/backend.py index 31b16e10..90a7d5ec 100644 --- a/modules/ing/backend.py +++ b/modules/ing/backend.py @@ -115,4 +115,6 @@ class INGBackend(BaseBackend, ICapBank, ICapBill): if not isinstance(bill, Bill): bill = self.get_bill(bill) self.browser.predownload(bill) - return self.browser.open("https://secure.ingdirect.fr" + bill._url, stream=True).content + request = self.browser.open("https://secure.ingdirect.fr" + bill._url, stream=True) + assert(request.headers['content-type'] == "application/pdf") + return request.content