Skip to content

Commit

Permalink
disable show_env request parameter (#12)
Browse files Browse the repository at this point in the history
* disable show_env request parameter

* fix test
  • Loading branch information
yuriyshafranyuk1 authored Feb 28, 2024
1 parent 62b16dd commit 3ee349c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion httpbin/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def get_headers(hide_env=True):

headers = dict(request.headers.items())

if hide_env and ('show_env' not in request.args):
if hide_env:
for key in ENV_HEADERS:
try:
del headers[key]
Expand Down
2 changes: 1 addition & 1 deletion test_httpbin.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ def test_headers_show_env(self):
}
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['headers'].keys())))
self.assertTrue({'Accept', 'Host', 'User-Agent'}.issubset(set(response.json['headers'].keys())))

def test_user_agent(self):
response = self.app.get(
Expand Down

0 comments on commit 3ee349c

Please sign in to comment.