forked from extern/httpie-cli
parent
05547224ce
commit
0f4dce98c7
@ -9,9 +9,11 @@ This project adheres to `Semantic Versioning <http://semver.org/>`_.
|
||||
`1.0.0-dev`_ (unreleased)
|
||||
-------------------------
|
||||
|
||||
* Added ``true``/``false`` as valid values for ``--verify``
|
||||
(in addition to ``yes``/``no``) and the boolean value is case-insensitive.
|
||||
* Fixed default headers being incorrectly case-sensitive.
|
||||
* Removed Python 2.6 support.
|
||||
* ``--verify`` now accepts ``true``/``false`` in addition to ``yes``/``no``
|
||||
and the boolean value is case-insensitive.
|
||||
|
||||
|
||||
|
||||
`0.9.8`_ (2016-12-08)
|
||||
|
@ -3,6 +3,7 @@ import sys
|
||||
|
||||
import requests
|
||||
from requests.adapters import HTTPAdapter
|
||||
from requests.structures import CaseInsensitiveDict
|
||||
|
||||
from httpie import sessions
|
||||
from httpie import __version__
|
||||
@ -106,9 +107,9 @@ def finalize_headers(headers):
|
||||
|
||||
|
||||
def get_default_headers(args):
|
||||
default_headers = {
|
||||
default_headers = CaseInsensitiveDict({
|
||||
'User-Agent': DEFAULT_UA
|
||||
}
|
||||
})
|
||||
|
||||
auto_json = args.data and not args.form
|
||||
if args.json or auto_json:
|
||||
|
@ -7,6 +7,21 @@ from utils import MockEnvironment, http, HTTP_OK
|
||||
from fixtures import FILE_PATH
|
||||
|
||||
|
||||
def test_default_headers_case_insensitive(httpbin):
|
||||
"""
|
||||
<https://github.com/jakubroztocil/httpie/issues/644>
|
||||
"""
|
||||
r = http(
|
||||
'--debug',
|
||||
'--print=H',
|
||||
httpbin.url + '/post',
|
||||
'CONTENT-TYPE:application/json-patch+json',
|
||||
'a=b',
|
||||
)
|
||||
assert 'CONTENT-TYPE: application/json-patch+json' in r
|
||||
assert 'Content-Type' not in r
|
||||
|
||||
|
||||
class TestImplicitHTTPMethod:
|
||||
def test_implicit_GET(self, httpbin):
|
||||
r = http(httpbin.url + '/get')
|
||||
|
Loading…
Reference in New Issue
Block a user