Skip to content

Commit

Permalink
handle testing BNF archive proxy (#372)
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin Ooghe committed Jun 17, 2021
1 parent 16b0fa1 commit 458fba7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion hyphe_backend/core.tac
Original file line number Diff line number Diff line change
Expand Up @@ -1060,7 +1060,9 @@ class Core(customJSONRPC):
response.code = 200
elif url.startswith("http:") and tryout == 4 and response.code == 403 and "IIS" in response.headers._rawHeaders.get('server', [""])[0]:
response.code = 301
elif not (deadline and deadline < time.time()) and \
# BNF Archives return 301 when using HEAD queries so do not consider it as error
elif not ("archivesinternet.bnf.fr" in proxy_host and 300 <= response.code < 400) and \
not (deadline and deadline < time.time()) and \
not (url.startswith("https") and response.code/100 == 4) and \
(use_proxy or response.code in [403, 405, 500, 501, 503]) and \
response.code not in [400, 404, 502]:
Expand Down

0 comments on commit 458fba7

Please sign in to comment.