Correctly pass headers in request to ATS
Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/502a3b50 Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/502a3b50 Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/502a3b50 Branch: refs/heads/master Commit: 502a3b5040fcf86a9d836a13029843299f3b8c0d Parents: ba2f123 Author: Thomas Jackson <jackso...@apache.org> Authored: Thu Apr 30 17:49:37 2015 -0700 Committer: Thomas Jackson <jackso...@apache.org> Committed: Thu Apr 30 17:49:37 2015 -0700 ---------------------------------------------------------------------- ci/tsqa/tests/test_keepalive.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/502a3b50/ci/tsqa/tests/test_keepalive.py ---------------------------------------------------------------------- diff --git a/ci/tsqa/tests/test_keepalive.py b/ci/tsqa/tests/test_keepalive.py index 3e77388..5216282 100644 --- a/ci/tsqa/tests/test_keepalive.py +++ b/ci/tsqa/tests/test_keepalive.py @@ -77,11 +77,13 @@ class KeepAliveInMixin(object): return request def _aux_KA_working_path_connid(self, protocol, headers=None): + if headers is None: + headers = {} with requests.Session() as s: url = '{0}://127.0.0.1:{1}/'.format(protocol, int(self.configs['records.config']['CONFIG']['proxy.config.http.server_ports'])) conn_id = None for x in xrange(1, 10): - ret = requests.get(url) + ret = requests.get(url, headers=headers) self.assertEqual(ret.status_code, 200) if conn_id is None: conn_id = ret.text @@ -440,6 +442,7 @@ class TestKeepAlive_Authorization_private(helpers.EnvironmentCase, BasicTestsOut self._aux_KA_working_path_connid("http", headers={'Authorization': 'Foo'}) + class TestKeepAlive_Authorization_no_private(helpers.EnvironmentCase, BasicTestsOutMixin, KeepAliveInMixin): @classmethod def setUpEnv(cls, env):