'https://httpbin.org/headers'

def test_headers(self):

    with self.app.test_client() as c:
        self.rv = c.get(self.url('/headers'), environ_base=env(), headers=headers(accept_encoding='gzip,    deflate,    sdch,    br', others={'Host': self.C.my_host_name, 'Referer': self.url('/extdomains/eu.httpbin.org/headers'), 'Cookie': '_ga=GA1.2.1161994079.1471765883', 'Hello-World': 'love_luciaz'}))
        parse_values = attributes(self.zmirror.parse)
        self.assertEqual('application/json', self.zmirror.parse.content_type, msg=self.dump())
        self.assertEqual('gzip,    deflate', self.zmirror.parse.client_header['accept-encoding'], msg=parse_values)
        self.assertEqual('https://eu.httpbin.org/headers', self.zmirror.parse.client_header['referer'], msg=self.dump())
        self.assertEqual('love_luciaz', self.zmirror.parse.client_header['hello-world'], msg=self.dump())
        self.assertEqual('httpbin.org', self.zmirror.parse.remote_domain, msg=self.dump())
        self.assertEqual('/headers', self.zmirror.parse.remote_path, msg=self.dump())
        remote_resp = self.zmirror.parse.remote_response
        remote_resp_json = json.loads(remote_resp.text)
        self.assertEqual(self.C.target_domain, remote_resp_json['headers']['Host'], msg=self.dump())
        h = load_rv_json(self.rv)['headers']
        self.assertEqual(self.C.my_host_name, h['Host'], msg=self.dump())
        self.assertEqual(self.url('/extdomains/eu.httpbin.org/headers'), h['Referer'], msg=self.dump())
        self.assertEqual('_ga=GA1.2.1161994079.1471765883', h['Cookie'], msg=self.dump())
        self.assertEqual('love_luciaz', h['Hello-World'], msg=self.dump())
        self.assertEqual('gzip,    deflate', h['Accept-Encoding'], msg=self.dump())
