mirror of
https://github.com/kennethreitz/httpbin.git
synced 2026-06-05 23:00:18 +00:00
Merge pull request #492 from javabrett/487-headers-dict-revert-457
Revert #457 "Support `show_env` param in `/headers`"
This commit is contained in:
+1
-1
@@ -342,7 +342,7 @@ def view_headers():
|
||||
description: The request's headers.
|
||||
"""
|
||||
|
||||
return jsonify(get_headers())
|
||||
return jsonify(get_dict('headers'))
|
||||
|
||||
|
||||
@app.route("/user-agent")
|
||||
|
||||
+2
-2
@@ -279,7 +279,7 @@ class HttpbinTestCase(unittest.TestCase):
|
||||
}
|
||||
response = self.app.get('/headers', headers=headers)
|
||||
self.assertEqual(response.status_code, 200)
|
||||
self.assertTrue({'Accept', 'Host', 'User-Agent'}.issubset(set(response.json.keys())))
|
||||
self.assertTrue({'Accept', 'Host', 'User-Agent'}.issubset(set(response.json['headers'].keys())))
|
||||
self.assertNotIn('Via', response.json)
|
||||
|
||||
def test_headers_show_env(self):
|
||||
@@ -291,7 +291,7 @@ class HttpbinTestCase(unittest.TestCase):
|
||||
}
|
||||
response = self.app.get('/headers?show_env=true', headers=headers)
|
||||
self.assertEqual(response.status_code, 200)
|
||||
self.assertTrue({'Accept', 'Host', 'User-Agent', 'Via'}.issubset(set(response.json.keys())))
|
||||
self.assertTrue({'Accept', 'Host', 'User-Agent', 'Via'}.issubset(set(response.json['headers'].keys())))
|
||||
|
||||
def test_user_agent(self):
|
||||
response = self.app.get(
|
||||
|
||||
Reference in New Issue
Block a user