refactor(api/core/workflow/nodes/http_request): Remove mask_authorization_header
because its alwary true. (#6379)
This commit is contained in:
@@ -43,7 +43,6 @@ def test_get(setup_http_mock):
|
||||
'headers': 'X-Header:123',
|
||||
'params': 'A:b',
|
||||
'body': None,
|
||||
'mask_authorization_header': False,
|
||||
}
|
||||
}, **BASIC_NODE_DATA)
|
||||
|
||||
@@ -52,7 +51,6 @@ def test_get(setup_http_mock):
|
||||
data = result.process_data.get('request', '')
|
||||
|
||||
assert '?A=b' in data
|
||||
assert 'api-key: Basic ak-xxx' in data
|
||||
assert 'X-Header: 123' in data
|
||||
|
||||
|
||||
@@ -103,7 +101,6 @@ def test_custom_authorization_header(setup_http_mock):
|
||||
'headers': 'X-Header:123',
|
||||
'params': 'A:b',
|
||||
'body': None,
|
||||
'mask_authorization_header': False,
|
||||
}
|
||||
}, **BASIC_NODE_DATA)
|
||||
|
||||
@@ -113,7 +110,6 @@ def test_custom_authorization_header(setup_http_mock):
|
||||
|
||||
assert '?A=b' in data
|
||||
assert 'X-Header: 123' in data
|
||||
assert 'X-Auth: Auth' in data
|
||||
|
||||
|
||||
@pytest.mark.parametrize('setup_http_mock', [['none']], indirect=True)
|
||||
@@ -136,7 +132,6 @@ def test_template(setup_http_mock):
|
||||
'headers': 'X-Header:123\nX-Header2:{{#a.b123.args2#}}',
|
||||
'params': 'A:b\nTemplate:{{#a.b123.args2#}}',
|
||||
'body': None,
|
||||
'mask_authorization_header': False,
|
||||
}
|
||||
}, **BASIC_NODE_DATA)
|
||||
|
||||
@@ -145,7 +140,6 @@ def test_template(setup_http_mock):
|
||||
|
||||
assert '?A=b' in data
|
||||
assert 'Template=2' in data
|
||||
assert 'api-key: Basic ak-xxx' in data
|
||||
assert 'X-Header: 123' in data
|
||||
assert 'X-Header2: 2' in data
|
||||
|
||||
@@ -173,7 +167,6 @@ def test_json(setup_http_mock):
|
||||
'type': 'json',
|
||||
'data': '{"a": "{{#a.b123.args1#}}"}'
|
||||
},
|
||||
'mask_authorization_header': False,
|
||||
}
|
||||
}, **BASIC_NODE_DATA)
|
||||
|
||||
@@ -181,7 +174,6 @@ def test_json(setup_http_mock):
|
||||
data = result.process_data.get('request', '')
|
||||
|
||||
assert '{"a": "1"}' in data
|
||||
assert 'api-key: Basic ak-xxx' in data
|
||||
assert 'X-Header: 123' in data
|
||||
|
||||
|
||||
@@ -207,7 +199,6 @@ def test_x_www_form_urlencoded(setup_http_mock):
|
||||
'type': 'x-www-form-urlencoded',
|
||||
'data': 'a:{{#a.b123.args1#}}\nb:{{#a.b123.args2#}}'
|
||||
},
|
||||
'mask_authorization_header': False,
|
||||
}
|
||||
}, **BASIC_NODE_DATA)
|
||||
|
||||
@@ -215,7 +206,6 @@ def test_x_www_form_urlencoded(setup_http_mock):
|
||||
data = result.process_data.get('request', '')
|
||||
|
||||
assert 'a=1&b=2' in data
|
||||
assert 'api-key: Basic ak-xxx' in data
|
||||
assert 'X-Header: 123' in data
|
||||
|
||||
|
||||
@@ -241,7 +231,6 @@ def test_form_data(setup_http_mock):
|
||||
'type': 'form-data',
|
||||
'data': 'a:{{#a.b123.args1#}}\nb:{{#a.b123.args2#}}'
|
||||
},
|
||||
'mask_authorization_header': False,
|
||||
}
|
||||
}, **BASIC_NODE_DATA)
|
||||
|
||||
@@ -252,7 +241,6 @@ def test_form_data(setup_http_mock):
|
||||
assert '1' in data
|
||||
assert 'form-data; name="b"' in data
|
||||
assert '2' in data
|
||||
assert 'api-key: Basic ak-xxx' in data
|
||||
assert 'X-Header: 123' in data
|
||||
|
||||
|
||||
@@ -278,14 +266,12 @@ def test_none_data(setup_http_mock):
|
||||
'type': 'none',
|
||||
'data': '123123123'
|
||||
},
|
||||
'mask_authorization_header': False,
|
||||
}
|
||||
}, **BASIC_NODE_DATA)
|
||||
|
||||
result = node.run(pool)
|
||||
data = result.process_data.get('request', '')
|
||||
|
||||
assert 'api-key: Basic ak-xxx' in data
|
||||
assert 'X-Header: 123' in data
|
||||
assert '123123123' not in data
|
||||
|
||||
@@ -305,7 +291,6 @@ def test_mock_404(setup_http_mock):
|
||||
'body': None,
|
||||
'params': '',
|
||||
'headers': 'X-Header:123',
|
||||
'mask_authorization_header': False,
|
||||
}
|
||||
}, **BASIC_NODE_DATA)
|
||||
|
||||
@@ -334,7 +319,6 @@ def test_multi_colons_parse(setup_http_mock):
|
||||
'type': 'form-data',
|
||||
'data': 'Referer:http://example5.com\nRedirect:http://example6.com'
|
||||
},
|
||||
'mask_authorization_header': False,
|
||||
}
|
||||
}, **BASIC_NODE_DATA)
|
||||
|
||||
|
Reference in New Issue
Block a user