Aaron Leopold
c8b8b2b022
Add several new known media types:
...
* CBZ: application/vnd.comicbook+zip, .cbz
* CBR: application/vnd.comicbook-rar, .cbr
* RAR: application/vnd.rar, .rar
* EPUB: application/epub+zip, .epub
* OPF: application/oebps-package+xml, .opf
* XHTML: application/xhtml+xml, .xhtml
2022-06-13 15:29:32 -07:00
James Tai
2fc4b156eb
Add MP3 (audio/mpeg) as a known media type.
2022-06-03 07:30:22 -07:00
Sergio Benitez
68185ce0e2
Update comment in 'Listener' sleep code.
2022-05-18 17:29:21 -07:00
Sergio Benitez
4c8bd61c4f
Unhide 'http' exports that shouldn't be hidden.
2022-05-08 01:08:22 -05:00
Sergio Benitez
0ba56ccbb3
Revamp shutdown to recover shutdown 'Rocket'.
...
The core improvement is that `Rocket::launch()` now resolves to
`Ok(Rocket<Ignite>)` on nominal shutdown. Furthermore, shutdown never
terminates the running process.
Other changes directly related to shutdown:
* Runtime worker thread names are now irrelevant to graceful shutdown.
* `ErrorKind::Runtime` was removed; `ErrorKind::Shutdown` was added.
* The `force` config value is only read from the default provider.
* If `force`, Rocket's constructed async runtime is terminated.
Other related changes:
* The exported `hyper` module docs properly reflect public re-exports.
2022-05-07 06:12:24 -05:00
Arthur Woimbée
4df97f0e25
Improve unrecognized TLS key header error message.
...
Resolves #2128 .
2022-05-05 08:00:24 -05:00
Sergio Benitez
ee4aa81847
Allow '[' and ']' in URI paths.
...
This is strictly noncompliant and they should be encoded, but browsers
routinely send them unencoded, so we allow them to avoid trouble.
2022-05-04 09:44:24 -07:00
Sergio Benitez
07460df279
Rework TLS listener/connection implementations.
...
The previous implementation allowed a trivial DoS attack in which the
client need simply maintain open connections with incomplete handshakes.
This commit resolves that by allowing a server worker to progress as
soon as a TCP connection has been established. This comes at the expense
of a more complex implementation necessitated by deficiencies in Hyper.
Potentially resolves #2118 .
2022-05-03 13:56:25 -07:00
Sergio Benitez
e9d46b917e
Fully 'drop()' I/O struct in 'CancellableIo'.
...
This should improve the reliability of graceful shutdown.
2022-05-03 13:55:43 -07:00
Sergio Benitez
bf84b1cdb5
Enable TCP_NODELAY on TCP-based connections.
...
We may want a more fine-grained approach to immediately transmitting
application data, but Hyper does not yet expose a suitable API.
Resolves #2062 .
2022-04-28 13:22:06 -07:00
Konrad Borowski
7bbe0457a5
Use new 2021 edition functionality.
...
* Remove `TryInto` and `TryFrom` imports.
* Replace `IntoIter::new()` with `.into_iter()`.
2022-04-19 18:35:55 -07:00
Sergio Benitez
4d83f73f86
Implement 'Eq' for 'MediaType', 'ContentType'.
...
This also fixes the 'Hash' implementation to match the docs.
Resolves #2132 .
2022-04-19 13:58:30 -07:00
Sergio Benitez
2a7eac01bb
Fix 'Segments::to_path_buf()' on Windows.
2022-04-19 13:06:02 -07:00
Sergio Benitez
ccf0b802bc
Disallow ':' in `PathBuf` guard on Windows.
...
Fixes #1949 .
2022-04-18 18:27:41 -07:00
Edgar Onghena
ff7cf68461
Make HTTP/2 optional via 'http2' feature.
...
Closes #2030 .
2022-03-08 15:13:24 -08:00
=?UTF-8?q?R=C3=A9mi=20Lauzier?=
f82d760b52
Use 'matches!' macro where possible.
2022-02-23 14:11:44 -08:00
Sergio Benitez
fda05bddd2
Update 'rustls' to 0.20.
...
Also updates 'tokio-rustls' to a compatible version.
Additionally depends on 'rustls-pemfile' which includes functionality
that was previously part of 'rustls' itself.
2022-02-22 17:30:42 -08:00
Sergio Benitez
502b11c177
Update 'x509-parser' to 0.13.
2022-02-22 13:01:05 -08:00
Sergio Benitez
2f59515752
Update 'x509-parser' to 0.12.
...
Closes #2100 .
2022-02-22 12:51:59 -08:00
Sergio Benitez
0ba5aac53e
Update codebase for latest nightly and stable.
2022-02-16 10:08:55 -08:00
Sergio Benitez
3616f25c0b
Update 'time' to 0.3, 'cookie' to 0.16.
...
Also reexport 'time' from the crate root.
2021-08-19 19:49:23 -07:00
Sergio Benitez
74be9c68b1
Add missing newline for better doc rendering.
2021-08-19 19:49:23 -07:00
Sergio Benitez
be3ceef4e3
Use 'hyper' instead of 'http' where possible.
2021-08-19 19:49:23 -07:00
Sergio Benitez
7ffe3a7360
Complete mTLS implementation.
...
Resolves #254 .
2021-07-09 00:05:44 -07:00
Sergio Benitez
bbc36ba27f
Initial implementation of mTLS.
...
Co-authored-by: Howard Su <howard0su@gmail.com>
Co-authored-by: Mikail Bagishov <bagishov.mikail@yandex.ru>
2021-07-09 00:05:20 -07:00
Sergio Benitez
76fab37e29
Rename 'remote_addr' to 'peer_address'.
2021-07-04 15:37:27 -07:00
Sergio Benitez
b5e3569554
Split TLS module into logical submodules.
2021-07-04 15:25:49 -07:00
Sergio Benitez
de4b3e3891
Make 'tls' its own module.
2021-07-04 15:01:55 -07:00
Sergio Benitez
efce2bc958
Make 'MediaType::with_params()' a builder method.
...
Instead of a constructor, 'MediaType::with_params()' and
'ContentType::with_params()' are now both builder methods. This allow
chaining the method to associated constants.
2021-07-04 13:50:19 -07:00
Sergio Benitez
75d851d011
Sync core 'UriDisplay' and 'FromUriParam' impls.
2021-07-02 08:17:22 -07:00
Sergio Benitez
c58b43700c
Add type-safe 'Host' type, 'Request::host()'.
...
Closes #1699 .
2021-07-02 06:48:40 -07:00
Mikail Bagishov
be933ce398
Apply clippy suggestions.
2021-06-30 14:13:19 -07:00
Sergio Benitez
e141ac8a19
Add 'RawStr::percent_encode_bytes()'.
2021-06-30 06:46:01 -07:00
Sergio Benitez
f818702f9b
Propagate TLS ciphersuite config to rustls.
...
Closes #1563 .
2021-06-29 11:17:59 -07:00
Sergio Benitez
7c8c06522c
Impl 'UriDisplay' for 'Vec', maps, nonzero ints.
2021-06-29 03:31:31 -07:00
Sergio Benitez
f3e08bf3f6
Add Markdown (text/markdown) as a known media type.
2021-06-26 12:02:19 -07:00
Sergio Benitez
c2960e7e6f
Uniformly implement utility traits on URI types.
2021-06-09 17:44:12 -07:00
Sergio Benitez
d2c2725689
Implement 'De(Serialize)' for 'Method'.
2021-06-09 17:07:26 -07:00
Sergio Benitez
6961a717d8
Use crates.io compatible internal package names.
2021-06-09 09:47:21 -07:00
Sergio Benitez
01436d2d24
Fix a ton of broken links.
2021-06-09 04:51:46 -07:00
Jeb Rosen
3b5f5afc6e
Advertise HTTP/2 support via ALPN.
2021-06-09 04:51:33 -07:00
Sergio Benitez
128234d9a8
Allow customizing and removing 'Server' header.
2021-06-08 23:09:57 -07:00
Sergio Benitez
723afa317a
Remove 'Copy' impl on 'Segments' iterator.
...
This ideally prevents logic bugs where one thinks they've modified the
iterator where, in reality, a new iterator has been returned.
2021-06-07 20:34:27 -07:00
Sergio Benitez
78352c787d
Add 'ContentType::EventStream' known media type.
...
The value maps to "text/event-stream".
2021-06-01 11:46:47 -07:00
Sergio Benitez
e73ff8c614
Impl 'PartialEq<Cow<RawStr>>' for 'RawStr'.
2021-06-01 11:16:40 -07:00
Sergio Benitez
faaa9c9065
Fixup URI (de)serialization.
2021-05-24 12:16:03 -07:00
Matthew Pomes
1233518733
Implement (De)Serialize for all URI variants.
...
Closes #1593 .
2021-05-24 12:15:52 -07:00
Sergio Benitez
a78814f1c5
Graduate contrib 'uuid' into core.
...
This has the following nice benefits:
* The 'Uuid' wrapper type is gone.
* 'Uuid' implements 'UriDisplay', 'FromUriParam'.
* The 'serialization' example merges in 'uuid'.
Resolves #1299 .
2021-05-22 11:01:00 -07:00
Sergio Benitez
f6a7087c84
Graduate 'helmet' as 'shield' into core.
...
The 'SpaceHelmet' fairing is now called 'Shield'. It features the
following changes and improvements:
* Headers which are now ignored by browsers are removed.
* 'XssFilter' is no longer an on-by-default policy.
* A new 'Permission' policy is introduced.
* 'Shield' is attached to all 'Rocket' instances by default.
* Default headers never allocate on 'Clone'.
* Policy headers are rendered once and cached at start-up.
* Improved use of typed URIs in policy types.
2021-05-22 11:01:00 -07:00
Sergio Benitez
28ba04b47b
Impl 'IntoCollection' for '[T; N]'.
...
This introduces const generics into the codebase for a more efficient,
clone-free 'IntoCollection' for arrays.
2021-05-22 11:01:00 -07:00