|
@@ -34,8 +34,10 @@ def get_airflow_api_info():
|
|
|
headers = {
|
|
|
'content-type': 'application/json',
|
|
|
'Authorization': f'basic {config.get("AIRFLOW", "api_token")}',
|
|
|
- 'Host': f'{config.get("AIRFLOW", "host_in_header")}'
|
|
|
}
|
|
|
+ host_in_header = config.get("AIRFLOW", "host_in_header", None)
|
|
|
+ if host_in_header not in ['', None]:
|
|
|
+ headers['Host'] = host_in_header
|
|
|
return uri_prefix, headers
|
|
|
|
|
|
|
|
@@ -44,8 +46,10 @@ def call_airflow_api(method, uri, args_dict):
|
|
|
headers = {
|
|
|
'content-type': 'application/json',
|
|
|
'Authorization': f'basic {config.get("AIRFLOW", "api_token")}',
|
|
|
- 'Host': f'{config.get("AIRFLOW", "host_in_header")}'
|
|
|
}
|
|
|
+ host_in_header = config.get("AIRFLOW", "host_in_header", None)
|
|
|
+ if host_in_header not in ['', None]:
|
|
|
+ headers['Host'] = host_in_header
|
|
|
if method == 'post':
|
|
|
return requests.post(uri_prefix + '/' + uri, headers=headers, **args_dict)
|
|
|
if method == 'get':
|