Commit Graph

178 Commits

Author SHA1 Message Date
IsaacBenghiat
ab9cd0ea11 Fix bug in calculating maximum frame size (#153) 2019-09-06 13:06:20 -05:00
Tom Christie
33c5fe0374
Merge pull request #310 from encode/drop-content-length-on-get-redirects
Drop Content-Length headers on GET redirects
2019-09-05 10:21:21 +01:00
Tom Christie
5961bd8ba3 Apply black formatting 2019-09-04 15:11:40 +01:00
Tom Christie
4336550d22 Add tests for dropping Content-Length headers 2019-09-04 15:06:14 +01:00
Yeray Diaz Diaz
fa74aaa6db Add test for origin from URL string (#312) 2019-09-04 13:43:24 +02:00
Seth Michael Larson
b8c5e7a852 Add os.environ fixture (#308) 2019-09-02 23:12:52 +02:00
Florimond Manca
40e6e8c99d
Refactor client functionality into middleware (#268)
Co-authored-by: yeraydiazdiaz <yeraydiazdiaz@gmail.com>

* Dispatcher middlewares

* Redirect and BasicAuth dispatchers
* Remove HTTPBasicAuth and reinstate trust_env logic
* Call resolve dispatcher correctly
* Fix redirection tests
* Add basic and custom auth dispatchers
* Reinstate extracting cookies from response
* Fix linting

* Refactor middleware interface
2019-09-01 23:01:14 +02:00
Tomás Farías
db7f2d0df3 Add support for SSLKEYLOGFILE (#301)
* Skip test if OpenSSL version is lower than 1.1.1

* Use bionic dist for Python 3.8 job

* Pass trust_env to SSLConfig use monkeypatch in testing

* Don't raise KeyError if SSLKEYLOGFILE is not set

* Move trust_env after verify and cert
2019-09-01 08:01:11 -05:00
Bakhtiyor Ruziev
e34d280673 Add server.url property in tests (#300)
* Add server.url to test server

* Move a property to top of the class
2019-09-01 09:07:22 +02:00
Florimond Manca
a46462764e Tighten up response.next() (#297) 2019-08-31 09:09:35 -05:00
Florimond Manca
994403bec9
Serve test server in thread (#292) 2019-08-29 23:17:14 +02:00
Min ho Kim
e9b20995f7 Fix typos in comments (#294) 2019-08-29 19:14:15 +02:00
toppk
9e420a5c34 Automatically convert Client.cookies and Client.headers on set (#274) 2019-08-27 19:25:30 -05:00
Seth Michael Larson
6f4f186522
Add easier debug logging for users (#277)
Co-Authored-By: Florimond Manca <florimond.manca@gmail.com>
2019-08-27 11:43:13 -05:00
Seth Michael Larson
e7aa6d6710
Force HTTP/1.1 on short-lived connections (#284) 2019-08-27 07:54:11 -05:00
Florimond Manca
3674058ff7
Parametrize tests with concurrency backend (#273)
* Parametrize tests with concurrency backend

* Refactor server restart

* Add no-backend test
2019-08-25 20:25:18 +02:00
Seth Michael Larson
1872ae873b
Add ConcurrencyBackend.start_tls() (#263) 2019-08-24 10:04:14 -05:00
Florimond Manca
a4b93b91c0 Add missing async test cases (#269) 2019-08-23 07:04:21 -05:00
florimondmanca
fdb13592c9
Encapsulate http_version into BaseStream 2019-08-21 09:12:01 +02:00
florimondmanca
14eb81f72d
Unify BaseReader and BaseWriter as BaseStream 2019-08-21 09:02:54 +02:00
Can Sarıgöl
4ea4af661d Raise TypeError if invalid parameter for HTTPVersionConfig (#253) 2019-08-20 17:39:05 -05:00
Tom Christie
e0b523dd1b
Merge pull request #241 from encode/protocol-support
Allow configuration of supported HTTP protocol versions.
2019-08-20 15:16:28 +01:00
Tom Christie
e69ee77843
Drop Protocol str enum class in favor of plain old strings (#251)
* Drop Protocol str enum class in favor of plain old strings

* Drop unused import
2019-08-20 15:15:53 +01:00
Tom Christie
c1ec1c33cd
Response.protocol -> Response.http_version (#250)
* Response.protocol -> Response.http_version

* Update docs
2019-08-20 15:15:38 +01:00
Tom Christie
dfbfa7c7ec Drop Protocol str enum class in favor of plain old strings 2019-08-20 14:17:26 +01:00
Tom Christie
b343ee4a70 Add Client(http_versions=...) support 2019-08-20 13:30:54 +01:00
Tom Christie
a770102fd2 Added http_versions to dispatch interface 2019-08-20 12:56:19 +01:00
Tom Christie
fc27fd2530 Test coverage for HTTPVersionConfig 2019-08-20 12:33:28 +01:00
Tom Christie
f72fa68802 'Protocols' -> 'HTTPVersions' 2019-08-20 12:21:07 +01:00
Tom Christie
cf098f8f4c Merge branch 'protocol-support' of https://github.com/encode/httpx into protocol-support 2019-08-20 12:03:55 +01:00
Can Sarıgöl
a0aff8d169 fixed __repr__ function of Headers and Url classes (#222) 2019-08-20 11:48:28 +01:00
Tom Christie
0e49f23b75 Initial pass at configuring supported protocol versions 2019-08-19 20:13:37 +01:00
Can Sarıgöl
79425b28d0 added control to calling decode for empty contents (#237)
* added tests for all decoder

* fixed BrotliDecoder for b"" value
2019-08-19 16:12:00 +01:00
Ordanis Sanchez
a960a2a8fd Release semaphore if connection is dropped (#230) 2019-08-18 14:44:24 -05:00
Florimond Manca
9c7d23ce29 Enforce that sync client uses asyncio-based backend (#232) 2019-08-18 09:41:37 -05:00
Can Sarıgöl
04d5ffb01b Add trust_env property to BaseClient (#187) 2019-08-17 10:09:49 -05:00
Saugat Pachhai
3451028251 Fix typos in docstrings 2019-08-17 09:07:57 -05:00
euri10
cad9c03500 Added links property to BaseResponse (#211)
* Added docstring and better typing for parsed_header_links

* Added docstring and better typing for links property
Added tests for it too

* Added --diff to black check to see where CI fails
Relaxed travis build on master only

* Fixed black issue removing a \t

* Put noxfile and travis.yml as they were before
2019-08-16 09:07:52 -05:00
Seth Michael Larson
df8874b733
Accept SSLContext into SSLConfig(verify=...) (#215) 2019-08-14 22:30:02 -05:00
Seth Michael Larson
af907e85e1
Implement Response.stream_text() (#183) 2019-08-14 21:56:17 -05:00
Can Sarıgöl
9536b76f5c Fail unit tests without 100% coverage (#206) 2019-08-14 21:45:28 -05:00
Can Sarıgöl
c5248e6c20 Run SSLConfig cert loading in threadpool (#209) 2019-08-14 21:30:01 -05:00
Tammo Behrends
bebedcbd5d Explicitly check is_redirect in simple test case (#208) 2019-08-14 06:22:12 -05:00
Seth Michael Larson
80dc3e274e
Use nox for automation and CI (#128) 2019-08-13 08:39:35 -05:00
Yeray Diaz Diaz
95dad247b5 Remove "Host" header on redirects if URL origin has changed (#199)
Fixes #198

* Reinstate accidentally removed return statement
2019-08-13 06:44:23 -05:00
Quentin Pradet
ebbc003c55 Fix invalid Content-Encoding header test (#197) 2019-08-09 08:10:59 -05:00
Stephen Brown II
fde30b8d14 Use pathlib.Path instead of os.path functions (#188) 2019-08-08 21:42:25 -05:00
Andreas Bernacca
de91fdfa16 Ignore Content-Encoding headers that are invalid (#196) 2019-08-08 21:33:55 -05:00
halbow
92fbe5fd87 Added base class HTTPError with request/response attribute (#162) 2019-08-06 08:20:48 -05:00
Seth Michael Larson
9142a893ff Move HSTS preload checking to client (#184) 2019-08-01 10:26:45 +01:00