From 2ef60a05a55f0b47b21203958d71c69c0058cad6 Mon Sep 17 00:00:00 2001 From: Simon Date: Sat, 29 Sep 2018 11:38:52 -0400 Subject: [PATCH] proper user agent for pycurl --- crawl_server/remote_http.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crawl_server/remote_http.py b/crawl_server/remote_http.py index 11452c4..7f527f9 100644 --- a/crawl_server/remote_http.py +++ b/crawl_server/remote_http.py @@ -106,6 +106,7 @@ class HttpDirectory(RemoteDirectory): self.curl.setopt(self.curl.SSL_VERIFYPEER, 0) self.curl.setopt(self.curl.SSL_VERIFYHOST, 0) self.curl.setopt(pycurl.TIMEOUT, HttpDirectory.TIMEOUT) + self.curl.setopt(pycurl.USERAGENT, config.HEADERS["User-Agent"]) self.curl_head = self._curl_handle() @@ -117,6 +118,7 @@ class HttpDirectory(RemoteDirectory): curl_head.setopt(pycurl.SSL_VERIFYHOST, 0) curl_head.setopt(pycurl.NOBODY, 1) curl_head.setopt(pycurl.TIMEOUT, HttpDirectory.TIMEOUT) + curl_head.setopt(pycurl.USERAGENT, config.HEADERS["User-Agent"]) return curl_head