def test_if_resp_headers_are_correct( self, agent_ar_process_perclass, valid_user_header, path, caching_headers_test, ): headers_present = {} headers_absent = [] if caching_headers_test is True: headers_present[ 'Cache-Control'] = "no-cache, no-store, must-revalidate" headers_present['Pragma'] = "no-cache" headers_present['Expires'] = "0" elif caching_headers_test is False: headers_absent.append("Cache-Control") headers_absent.append("Pragma") headers_absent.append("Expires") # caching_headers_test == "skip", do nothing generic_response_headers_verify_test( agent_ar_process_perclass, valid_user_header, path, assert_headers=headers_present, assert_headers_absent=headers_absent, )
def test_if_resp_headers_are_correct( self, agent_ar_process_perclass, valid_user_header, path, caching_headers_test, ): headers_present = {} headers_absent = [] headers_present['Server'] = "openresty" if caching_headers_test is True: headers_present['Cache-Control'] = "no-cache, no-store, must-revalidate" headers_present['Pragma'] = "no-cache" headers_present['Expires'] = "0" elif caching_headers_test is False: headers_absent.append("Cache-Control") headers_absent.append("Pragma") headers_absent.append("Expires") # caching_headers_test == "skip", do nothing generic_response_headers_verify_test( agent_ar_process_perclass, valid_user_header, path, assert_headers=headers_present, assert_headers_absent=headers_absent, )
def test_if_xaccel_header_is_passed_to_client_by_ar( self, agent_ar_process, valid_user_header, mocker): accel_buff_header = {"X-Accel-Buffering": "TEST"} mocker.send_command( endpoint_id='http:///run/dcos/dcos-log.sock', func_name='set_response_headers', aux_data=accel_buff_header, ) generic_response_headers_verify_test( agent_ar_process, valid_user_header, '/system/v1/logs/foo/bar', assert_headers=accel_buff_header, )
def test_if_xaccel_header_is_passed_to_client_by_ar( self, master_ar_process_perclass, valid_user_header, mocker): accel_buff_header = {"X-Accel-Buffering": "TEST"} mocker.send_command( endpoint_id='http:///run/dcos/dcos-log.sock', func_name='set_response_headers', aux_data=accel_buff_header, ) generic_response_headers_verify_test(master_ar_process_perclass, valid_user_header, '/system/v1/logs/foo/bar', assert_headers=accel_buff_header, )