Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Heph-HTTP crate #461

Merged
merged 81 commits into from
May 24, 2021
Merged
Changes from 1 commit
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
0f856ed
Add initial version of heph-http
Thomasdezeeuw Apr 30, 2021
3a56fcb
Expose lifetime of HeaderName
Thomasdezeeuw Apr 30, 2021
b1dcf46
Add tests for HeaderName
Thomasdezeeuw Apr 30, 2021
c5189f5
Implement fmt::{Debug, Display} for ParseIntError
Thomasdezeeuw Apr 30, 2021
cc0de4e
Add tests for Header type
Thomasdezeeuw Apr 30, 2021
51db066
Add a lifetime to FromBytes
Thomasdezeeuw Apr 30, 2021
cce8b11
Add tests for the Headers type
Thomasdezeeuw Apr 30, 2021
3842ea5
Add test for Header::from_str matching case-insensitive
Thomasdezeeuw Apr 30, 2021
14449cb
Add tests for Method type
Thomasdezeeuw Apr 30, 2021
d8b48ab
Add tests for the Version type
Thomasdezeeuw Apr 30, 2021
26c6aa8
Add more StatusCode constants
Thomasdezeeuw Apr 30, 2021
aca8738
Remove dev allow statements
Thomasdezeeuw Apr 30, 2021
8af7ef6
Fix some doc links
Thomasdezeeuw Apr 30, 2021
b67e541
Implement FromBytes for all unsigned integers
Thomasdezeeuw Apr 30, 2021
527aa5f
Check path first in my_ip example
Thomasdezeeuw Apr 30, 2021
7dd45cb
Add some more tests for the integer impls of FromBytes
Thomasdezeeuw Apr 30, 2021
d7d517f
Add Method::as_str
Thomasdezeeuw Apr 30, 2021
3226db7
Add Version::as_str
Thomasdezeeuw Apr 30, 2021
3d1d3fd
Add Header::DATE
Thomasdezeeuw Apr 30, 2021
b6be5fa
Add Version::{major, minor}
Thomasdezeeuw Apr 30, 2021
25a70cf
Add FromBytes implementation for SystemTime
Thomasdezeeuw Apr 30, 2021
cfb3181
Automatically add Date header in Connection::respond
Thomasdezeeuw Apr 30, 2021
4249526
Add StatusCode::phrase
Thomasdezeeuw Apr 30, 2021
f108912
Expand API for Response
Thomasdezeeuw Apr 30, 2021
eab0fbe
Add connection::Body::is_empty
Thomasdezeeuw Apr 30, 2021
381d752
Add Request::new
Thomasdezeeuw Apr 30, 2021
c74ebd7
Implement Body for Cow<[u8]>
Thomasdezeeuw Apr 30, 2021
59e9319
Expand the list of known HTTP headers
Thomasdezeeuw May 1, 2021
3924b87
Implement multiple HTTP Body types
Thomasdezeeuw May 3, 2021
d55a82f
Add FileBody body type
Thomasdezeeuw May 4, 2021
2df91cd
Add StatusCode::includes_body
Thomasdezeeuw May 4, 2021
6e71fa5
Replace Method::is_head with expects_body
Thomasdezeeuw May 4, 2021
49c1035
Various improvements to server::Connection
Thomasdezeeuw May 4, 2021
8d914c4
Expand server::Body API
Thomasdezeeuw May 4, 2021
150f8ea
Add server::Body:{recv, recv_vectored}
Thomasdezeeuw May 4, 2021
0b9c2da
Update my_ip HTTP example
Thomasdezeeuw May 4, 2021
2a345cc
Add Bytes::{spare_capacity, has_spare_capacity}
Thomasdezeeuw May 4, 2021
8506056
Add BytesVectored::{spare_capacity, has_spare_capacity}
Thomasdezeeuw May 4, 2021
2139caf
Use BytesVectored::has_spare_capacity when possible
Thomasdezeeuw May 4, 2021
397707b
Use Bytes(Vectored)::{spare_capacity, has_spare_capacity} more
Thomasdezeeuw May 7, 2021
1726e2d
Add const_fn_trait_bound feature
Thomasdezeeuw May 7, 2021
225fa07
Set Connection header for HTTP/1.0 responses
Thomasdezeeuw May 7, 2021
61b1617
Use checked addition and multiplication in FromBytes for uints
Thomasdezeeuw May 7, 2021
f5a8d1d
Always remove complete request Body from Connection
Thomasdezeeuw May 7, 2021
539081e
Rename FromBytes to FromHeaderValue
Thomasdezeeuw May 8, 2021
4ade7f3
Add timeouts to the my_ip example
Thomasdezeeuw May 8, 2021
fa8c8be
Add --workspace to all Cargo commands
Thomasdezeeuw May 13, 2021
2641464
Fix some Clippy warnings in convert_trace tool
Thomasdezeeuw May 13, 2021
3d092de
Fix and ignore some Clippy warnings
Thomasdezeeuw May 13, 2021
c43492a
Add Headers::is_empty
Thomasdezeeuw May 13, 2021
9e1f552
Fix StreamingBody's Body implementation
Thomasdezeeuw May 13, 2021
7a2b672
Remove const_fn feature
Thomasdezeeuw May 13, 2021
a6f0653
Return RequestError::HeadTooLarge if the HTTP head is too large
Thomasdezeeuw May 18, 2021
ff4b439
Document HttpServer and the server module
Thomasdezeeuw May 18, 2021
73f5232
Add Headers::clear
Thomasdezeeuw May 18, 2021
019c53b
Add Bytes::limit and LimitedBytes
Thomasdezeeuw May 18, 2021
792cb9c
Add BytesVectored::limit
Thomasdezeeuw May 19, 2021
1b5cb7c
Move LimitedBytes after BytesVectored trait
Thomasdezeeuw May 19, 2021
aadc921
Support chunked transfer encoding in HTTP server
Thomasdezeeuw May 19, 2021
b5a55c3
Simplify Headers::from_httparse_headers
Thomasdezeeuw May 19, 2021
94da933
Change Connection::{send_response,respond} API
Thomasdezeeuw May 19, 2021
be251cf
Mark some functions as constant
Thomasdezeeuw May 19, 2021
a48630c
Fix Clippy warnings
Thomasdezeeuw May 19, 2021
2567c12
Derive common traits for BodyLength
Thomasdezeeuw May 22, 2021
aaf6169
Derive Eq and Partial for StatusCode
Thomasdezeeuw May 22, 2021
0a5714e
Add some more tests for Headers
Thomasdezeeuw May 22, 2021
11c1dc0
Add some tests for the HttpServer
Thomasdezeeuw May 22, 2021
98f8d32
Cleanup Connection docs
Thomasdezeeuw May 22, 2021
d428a06
Enable some warnings
Thomasdezeeuw May 22, 2021
fbcb2e9
Don't link LICENSE file
Thomasdezeeuw May 23, 2021
2d94dc4
Fix all warnings
Thomasdezeeuw May 23, 2021
3b21bea
Relax lifetime in HeaderName::from_lowercase
Thomasdezeeuw May 23, 2021
e5457a5
Implement From<&Header> for Headers
Thomasdezeeuw May 23, 2021
bb9bec9
Implement FromIterator and Extend for Headers
Thomasdezeeuw May 23, 2021
86cff1c
Rename Body::write_response to write_message
Thomasdezeeuw May 23, 2021
d731331
Implement From<[Header; N]> for Headers
Thomasdezeeuw May 23, 2021
81f5430
Small fixes
Thomasdezeeuw May 23, 2021
25e5777
Move some constants and function to the crate root
Thomasdezeeuw May 24, 2021
a11c475
Expand testing
Thomasdezeeuw May 24, 2021
cfff03c
Add initial implementation of the client module
Thomasdezeeuw May 24, 2021
7fd3a60
Add tests for the http::Client
Thomasdezeeuw May 24, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add Header::DATE
The "Date" header, should be send with responses.
Thomasdezeeuw committed May 17, 2021
commit 3d1d3fd2a419b8cfdd41c3e77530971d6466f696
1 change: 1 addition & 0 deletions http/src/header.rs
Original file line number Diff line number Diff line change
@@ -322,6 +322,7 @@ impl HeaderName<'static> {
// NOTE: we adding here also add to the
// `functional::header::from_str_known_headers` test.
known_headers!(
4: [ (DATE, "date") ],
5: [ (ALLOW, "allow") ],
10: [ (USER_AGENT, "user-agent") ],
12: [ (X_REQUEST_ID, "x-request-id") ],
1 change: 1 addition & 0 deletions http/tests/functional/header.rs
Original file line number Diff line number Diff line change
@@ -127,6 +127,7 @@ fn parse_header() {
#[test]
fn from_str_known_headers() {
let known_headers = &[
"date",
"allow",
"user-agent",
"x-request-id",