Skip to content
This repository was archived by the owner on Feb 23, 2021. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions hacheck/checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@

TIMEOUT = 10

HTTP_HEADERS_TO_COPY = ('Host',)


class Timeout(Exception):
pass
Expand Down Expand Up @@ -84,7 +82,7 @@ def check_http(service_name, port, check_path, io_loop, query_params, headers):
if not check_path.startswith("/"):
check_path = "/" + check_path # pragma: no cover
headers_out = {'User-Agent': 'hastate %s' % (__version__)}
for header in HTTP_HEADERS_TO_COPY:
for header in config.config['http_headers_to_copy']:
if header in headers:
headers_out[header] = headers[header]
if config.config['service_name_header']:
Expand Down
3 changes: 2 additions & 1 deletion hacheck/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ def max_or_int(some_str_value):
'log_path': (str, 'stderr'),
'mysql_username': (str, None),
'mysql_password': (str, None),
'rlimit_nofile': (max_or_int, None)
'rlimit_nofile': (max_or_int, None),
'http_headers_to_copy': (list, ['Host'])
}


Expand Down