From 27d94e4433e32ba8be17965cae4b6469cd2fc563 Mon Sep 17 00:00:00 2001 From: Yuval Adam <_@yuv.al> Date: Sun, 2 Jun 2019 12:51:19 +0300 Subject: Fix error when Set-Cookie is missing --- cron/handler.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'cron/handler.py') diff --git a/cron/handler.py b/cron/handler.py index e742240..c8d79f8 100644 --- a/cron/handler.py +++ b/cron/handler.py @@ -38,8 +38,8 @@ def scrape_fallback(res, http, url): } res = http.request('GET', url, headers=headers) - ck = res.headers['Set-Cookie'] - headers['Cookie'] = ck + if 'Set-Cookie' in res.headers: + headers['Cookie'] = res.headers['Set-Cookie'] res = http.request('GET', url, headers=headers) resdat = res.data.decode('utf-8') -- cgit v1.3.1