Prechádzať zdrojové kódy

Merge branch 'master' of http://gogsb.soaringnova.com/sxwl_DL/datax-admin

Zhang Li 2 rokov pred
rodič
commit
f55e79b2b5
2 zmenil súbory, kde vykonal 6 pridanie a 3 odobranie
  1. 6 2
      app/core/airflow/uri.py
  2. 0 1
      production.ini

+ 6 - 2
app/core/airflow/uri.py

@@ -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':

+ 0 - 1
production.ini

@@ -24,7 +24,6 @@ url=aihub-backend-yili-test:8080
 
 [AIRFLOW]
 uri=aihub-backend-af-yili-test:8080
-host_in_header=airflow-web.sxkj.com
 api_token=YWRtaW46YWRtaW4=