Commit Graph

379 Commits

Author SHA1 Message Date
Jacob Rothstein 03c2babfa5
more robust url extraction from httparse
in particular, this commit adds support for the connect method
2020-05-28 12:55:34 -07:00
Ben-Lichtman c555ab1e56 removed debugging prints left in by accident 2020-05-27 16:30:00 +10:00
Ben-Lichtman d95b421cb3 exposed some internal functions and structures to the public API 2020-05-27 16:14:14 +10:00
Yoshua Wuyts 2383cf2946 v2.0.0 2020-05-23 00:31:54 +02:00
Yoshua Wuyts 7a7b358265
Merge pull request #105 from jbr/update-http-types
async-h1 update for http-types 2.0.0
2020-05-23 00:28:10 +02:00
Jacob Rothstein 12f4acea4b
update for 2.0.0 2020-05-22 15:09:02 -07:00
Jacob Rothstein c3106b7d55
some further tidying 2020-05-19 20:11:37 -07:00
Jacob Rothstein d26570a324
incorporate review feedback 2020-05-18 15:59:24 -07:00
Jacob Rothstein 9fd5ea0574
update http-types to master 2020-05-18 15:02:26 -07:00
Yoshua Wuyts 428fb9e8c6
Merge pull request #111 from http-rs/simplify-client-example
simplify client example
2020-05-17 18:52:39 +02:00
Yoshua Wuyts db07b06cd3 simplify client example 2020-05-15 18:45:21 +02:00
Yoshua Wuyts 6e36a6a57b
Merge pull request #97 from http-rs/more-logs
Server encoder state machine
2020-05-15 18:28:42 +02:00
Yoshua Wuyts 030d9d4b12
Merge pull request #110 from jbr/100-continue
Add support for `Expect` header
2020-05-15 18:26:35 +02:00
Jacob Rothstein bfcfd31bef
add support for Expect: 100-continue 2020-05-13 17:46:30 -07:00
Yoshua Wuyts 726119437d
Merge pull request #102 from jbr/add-unsupported-version-number-to-debug-message
include the unsupported http version number in the ensure message
2020-05-11 11:54:33 +02:00
Yoshua Wuyts 059dff8d77
Merge pull request #107 from jbr/no-addr
No addr needed for accept
2020-05-08 12:23:02 +02:00
Jacob Rothstein 0999baf36b
use set_host + set_port instead of *r.url_mut() =
and also add some tests
2020-05-07 14:11:29 -07:00
Jacob Rothstein 7ca8f9a29e
addr not required 2020-05-04 21:08:16 -07:00
Jacob Rothstein 704256b6d5
set request url host from host header 2020-05-01 17:25:42 -07:00
Jacob Rothstein 0300719da4
rustfmt 2020-04-24 14:52:08 -07:00
Jacob Rothstein a01f91f91d
include the unsupported http version number in the ensure message 2020-04-24 14:49:36 -07:00
Yoshua Wuyts c1780d602c
Merge pull request #98 from gdamjan/filter-headers-out
filter out content-length and transfer-encoding from pass Response
2020-04-24 22:33:49 +02:00
Дамјан Георгиевски 22aedd142f filter out content-length and transfer-encoding from pass Response
the Response (res) in server::encode::Encoder might already have
content-length or transfer-encoding, which even might be wrong (if set
manually). Filter them out when iterating the response headers, proper
values were anyway written to the head before.
2020-04-24 13:02:01 +02:00
Yoshua Wuyts 9fb31d1cd4 rename methods again 2020-04-24 00:16:37 +02:00
Yoshua Wuyts ea3fb645f1 rename exec to dispatch 2020-04-24 00:13:45 +02:00
Yoshua Wuyts 6b4c34ae1c Simplify state machine internals more 2020-04-24 00:05:48 +02:00
Yoshua Wuyts 4cf4c45c27 remove duplicate logs 2020-04-23 23:37:02 +02:00
Yoshua Wuyts c28119c323
Merge pull request #96 from gdamjan/fix-double-date
Don't add the Date header in a response if it already exists
2020-04-23 23:28:03 +02:00
Yoshua Wuyts 4444461577 Normalize enum names 2020-04-23 23:19:07 +02:00
Yoshua Wuyts e5f5500adf s/bytes_read/bytes_written/ 2020-04-23 23:14:44 +02:00
Yoshua Wuyts a39b30f22c Use state machine for server encoder as well 2020-04-23 23:13:46 +02:00
Дамјан Георгиевски 2b8f212cdf Don't add the Date header if it already exists
the response can already contain a date header, either because it came
from the async_h1::client::connect, or because the user set it manually.
In that case don't add a second date header.
2020-04-20 21:42:15 +02:00
Yoshua Wuyts daaa9cc7b1
Merge pull request #90 from http-rs/zero-test
create a long chunked test
2020-04-18 16:55:59 +02:00
Yoshua Wuyts dd1bc1eac4 v1.1.2 2020-04-18 16:39:13 +02:00
Yoshua Wuyts 24d30f41fb
Merge pull request #94 from http-rs/fix-chunked-encoding
fix(server): correct handling of pending state in chunked encoding
2020-04-18 16:37:36 +02:00
dignifiedquire a561f4cbd6 fix(server): correct handling of pending state in chunked encoding 2020-04-18 15:28:20 +02:00
Yoshua Wuyts c496b79033 strip deps 2020-04-18 11:55:00 +02:00
Yoshua Wuyts bc778d0ff2 rename test cases to include "encode" in name 2020-04-18 11:39:13 +02:00
Yoshua Wuyts ef7ceba815 fix warnings 2020-04-18 11:36:43 +02:00
Yoshua Wuyts dc983b895d two new test cases 2020-04-18 11:17:54 +02:00
Yoshua Wuyts 463b47b14a v1.1.1 2020-04-18 09:44:36 +02:00
Yoshua Wuyts 4580118751
Merge pull request #89 from gdamjan/remove-request-date
no need to send date header in client
2020-04-17 12:30:37 +02:00
Yoshua Wuyts 9d289a4a4b
Merge pull request #86 from gdamjan/fix-double-host
Don't add the Host header if it already exists
2020-04-16 15:55:42 +02:00
Дамјан Георгиевски 9d6aa32549 Don't add the Host header if it already exists
the request can already contain a host header, either because it came
from the async_h1::accept, or because the user set it manually. In that
case don't add a second host header (the one based on `req.url()`).

Update http-types to "1.2.0", because it's the first version that
introduced `headers::HOST`.
2020-04-16 15:01:44 +02:00
Дамјан Георгиевски d1eba8b0d2 no need to send date header in client
The date header is optional for clients, but also seems to be
discouraged. It's so rare so maybe leave it to the user.

https://tools.ietf.org/html/rfc7231#section-7.1.1.2
> A user agent MAY send a Date…

The older RFC https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.18
> Clients SHOULD only send a Date header field in messages that include an entity-body,
> as in the case of the PUT and POST requests, and even then it is optional. A client
> without a clock MUST NOT send a Date header field in a request.
2020-04-16 14:51:52 +02:00
Yoshua Wuyts b911766608
Merge pull request #92 from vkill/client-encode-with-Connect
fix request line url when method is CONNECT
2020-04-16 13:51:13 +02:00
Yoshua Wuyts 8f1c341cb4
Update src/client/encode.rs 2020-04-16 13:47:40 +02:00
vkill 0e1c3d179e fix request line url when method is CONNECT 2020-04-15 18:33:17 +08:00
Yoshua Wuyts be0bafa809 create a long chunked test 2020-04-14 23:17:50 +02:00
Yoshua Wuyts 0d1ed825ad
Merge pull request #84 from http-rs/rework-chunked-encoder
Rework chunked encoder
2020-04-14 16:18:03 +02:00