mirror of
https://github.com/httpie/cli.git
synced 2026-06-20 11:32:56 +02:00
Avoid override of headers by urllib3 when unset (#1502)
* Pass SKIP_HEADER const when header is unset * Hide SKIP_HEADER constant when displaying headers * Test that omits User-Agent
This commit is contained in:
1 parent
3664644722
commit
cbe53ed79a
3 files changed
+15
No files matched your search
@@ -196,6 +196,14 @@ def test_unset_host_header(httpbin_both):
|
||||
assert 'Host' not in r.json['headers'] # default Host unset
|
||||
|
||||
|
||||
def test_unset_useragent_header(httpbin_both):
|
||||
r = http('GET', httpbin_both + '/headers')
|
||||
assert 'User-Agent' in r.json['headers'] # default User-Agent present
|
||||
|
||||
r = http('GET', httpbin_both + '/headers', 'User-Agent:')
|
||||
assert 'User-Agent' not in r.json['headers'] # default User-Agent unset
|
||||
|
||||
|
||||
def test_headers_empty_value(httpbin_both):
|
||||
r = http('GET', httpbin_both + '/headers')
|
||||
assert r.json['headers']['Accept'] # default Accept has value
|
||||
|
||||
Reference in new issue
Block a user