Skip to content

Commit

Permalink
fix bad use of string.contains (#372)
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin Ooghe committed Jun 17, 2021
1 parent 458fba7 commit 64ebf24
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions hyphe_backend/crawler/hcicrawler/spiders/pages.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ def handle_response(self, response):
redir_url = response.headers['Location']
if redir_url.startswith("/"):
redir_url = "%s%s" % (self.archivehost, redir_url)
if ARCHIVES["URL_PREFIX"].contains("archivesinternet.bnf.fr"):
if "archivesinternet.bnf.fr" in ARCHIVES["URL_PREFIX"]:
if "depth" in response.meta:
response.meta['depth'] -= 1
else:
Expand Down Expand Up @@ -399,7 +399,7 @@ def _request(self, url, noproxy=False, **kw):
if self.phantom:
kw['method'] = 'HEAD'
if ARCHIVES["ENABLED"]:
if ARCHIVES["URL_PREFIX"].contains("archivesinternet.bnf.fr"):
if "archivesinternet.bnf.fr" in ARCHIVES["URL_PREFIX"]:
kw['headers'] = {
"BnF-OSWM-User-Name": "WS-HYPHE_%s_%s" % (HYPHE_PROJECT, self.job)
}
Expand Down

0 comments on commit 64ebf24

Please sign in to comment.