Commit a3bd1716 authored by nanahira's avatar nanahira

add custom request header

parent f5492f86
Pipeline #336 failed with stages
in 2 minutes and 13 seconds
...@@ -60,7 +60,7 @@ def generate_hash(id, form): ...@@ -60,7 +60,7 @@ def generate_hash(id, form):
for url in urls: for url in urls:
if url.startswith("http://") or url.startswith("https://"): if url.startswith("http://") or url.startswith("https://"):
resp = requests.get(url) resp = requests.get(url=url, header=config.REQUEST_HEADERS)
if resp.status_code != 200: if resp.status_code != 200:
raise HashException('Invalid response from %s (status code %s)' % (resp.url, resp.status_code)) raise HashException('Invalid response from %s (status code %s)' % (resp.url, resp.status_code))
md5.update(resp.content) md5.update(resp.content)
......
...@@ -36,3 +36,6 @@ SECRET_KEY = 'change-me' ...@@ -36,3 +36,6 @@ SECRET_KEY = 'change-me'
# Git repository base URL. # Git repository base URL.
URL = 'https://github.com/bui/taiko-web/' URL = 'https://github.com/bui/taiko-web/'
# Custom request header for admin page
REQUEST_HEADERS = {}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment