diff options
| author | Yuval Adam <_@yuv.al> | 2019-06-02 12:51:19 +0300 |
|---|---|---|
| committer | Yuval Adam <_@yuv.al> | 2019-06-02 12:51:19 +0300 |
| commit | 27d94e4433e32ba8be17965cae4b6469cd2fc563 (patch) | |
| tree | 07208e441f15e902c15b78efdb14a41fafcff5d2 /cron/handler.py | |
| parent | ba04e9973d2a803fcaeac7e60780929f16b145d7 (diff) | |
Fix error when Set-Cookie is missing
Diffstat (limited to 'cron/handler.py')
| -rw-r--r-- | cron/handler.py | 4 |
1 files changed, 2 insertions, 2 deletions
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') |
