2018-06-07 13:34:47 +00:00
|
|
|
[package]
|
|
|
|
name = "rocket_http"
|
2019-05-13 23:18:48 +00:00
|
|
|
version = "0.5.0-dev"
|
2018-06-07 13:34:47 +00:00
|
|
|
authors = ["Sergio Benitez <sb@sergio.bz>"]
|
|
|
|
description = """
|
|
|
|
Types, traits, and parsers for HTTP requests, responses, and headers.
|
|
|
|
"""
|
2019-05-13 23:18:48 +00:00
|
|
|
documentation = "https://api.rocket.rs/v0.5/rocket_http/"
|
2018-06-07 13:34:47 +00:00
|
|
|
homepage = "https://rocket.rs"
|
|
|
|
repository = "https://github.com/SergioBenitez/Rocket"
|
|
|
|
readme = "../../README.md"
|
|
|
|
keywords = ["rocket", "web", "framework", "http"]
|
2020-06-04 05:36:42 +00:00
|
|
|
license = "MIT OR Apache-2.0"
|
2018-06-07 13:34:47 +00:00
|
|
|
categories = ["web-programming"]
|
2019-06-13 01:33:40 +00:00
|
|
|
edition = "2018"
|
2018-06-07 13:34:47 +00:00
|
|
|
|
|
|
|
[features]
|
2018-11-09 07:37:37 +00:00
|
|
|
default = []
|
2018-06-07 13:34:47 +00:00
|
|
|
tls = ["rustls", "hyper-sync-rustls"]
|
2020-06-05 01:54:23 +00:00
|
|
|
private-cookies = ["cookie/private", "cookie/key-expansion"]
|
2018-06-07 13:34:47 +00:00
|
|
|
|
|
|
|
[dependencies]
|
2019-11-05 17:26:48 +00:00
|
|
|
smallvec = "1.0"
|
2018-06-07 13:34:47 +00:00
|
|
|
percent-encoding = "1"
|
2019-05-19 17:58:19 +00:00
|
|
|
hyper = { version = "0.12.31", default-features = false, features = ["tokio"] }
|
|
|
|
http = "0.1.17"
|
|
|
|
mime = "0.3.13"
|
2020-05-27 04:37:30 +00:00
|
|
|
time = "0.2.11"
|
2018-06-07 13:34:47 +00:00
|
|
|
indexmap = "1.0"
|
2020-06-05 01:59:11 +00:00
|
|
|
rustls = { version = ">=0.16, <=0.17", optional = true }
|
Overhaul URI types.
This is fairly large commit with several entangled logical changes.
The primary change in this commit is to completely overhaul how URI
handling in Rocket works. Prior to this commit, the `Uri` type acted as
an origin API. Its parser was minimal and lenient, allowing URIs that
were invalid according to RFC 7230. By contrast, the new `Uri` type
brings with it a strict RFC 7230 compliant parser. The `Uri` type now
represents any kind of valid URI, not simply `Origin` types. Three new
URI types were introduced:
* `Origin` - represents valid origin URIs
* `Absolute` - represents valid absolute URIs
* `Authority` - represents valid authority URIs
The `Origin` type replaces `Uri` in many cases:
* As fields and method inputs of `Route`
* The `&Uri` request guard is now `&Origin`
* The `uri!` macro produces an `Origin` instead of a `Uri`
The strict nature of URI parsing cascaded into the following changes:
* Several `Route` methods now `panic!` on invalid URIs
* The `Rocket::mount()` method is (correctly) stricter with URIs
* The `Redirect` constructors take a `TryInto<Uri>` type
* Dispatching of a `LocalRequest` correctly validates URIs
Overall, URIs are now properly and uniformly handled throughout Rocket's
codebase, resulting in a more reliable and correct system.
In addition to these URI changes, the following changes are also part of
this commit:
* The `LocalRequest::cloned_dispatch()` method was removed in favor of
chaining `.clone().dispatch()`.
* The entire Rocket codebase uses `crate` instead of `pub(crate)` as a
visibility modifier.
* Rocket uses the `crate_visibility_modifier` and `try_from` features.
A note on unsafety: this commit introduces many uses of `unsafe` in the
URI parser. All of these uses are a result of unsafely transforming byte
slices (`&[u8]` or similar) into strings (`&str`). The parser ensures
that these casts are safe, but of course, we must label their use
`unsafe`. The parser was written to be as generic and efficient as
possible and thus can parse directly from byte sources. Rocket, however,
does not make use of this fact and so would be able to remove all uses
of `unsafe` by parsing from an existing `&str`. This should be
considered in the future.
Fixes #443.
Resolves #263.
2018-07-29 01:26:15 +00:00
|
|
|
state = "0.4"
|
2020-05-30 08:49:32 +00:00
|
|
|
cookie = { version = "0.14.0", features = ["percent-encode"] }
|
2018-10-28 11:18:39 +00:00
|
|
|
pear = "0.1"
|
2019-10-27 15:50:49 +00:00
|
|
|
unicode-xid = "0.2"
|
2018-06-07 13:34:47 +00:00
|
|
|
|
|
|
|
[dependencies.hyper-sync-rustls]
|
2020-06-05 01:59:11 +00:00
|
|
|
version = ">=0.3.0-rc.6, <=0.3.0-rc.17"
|
2018-06-07 13:34:47 +00:00
|
|
|
features = ["server"]
|
|
|
|
optional = true
|
|
|
|
|
|
|
|
[dev-dependencies]
|
2019-05-13 23:18:48 +00:00
|
|
|
rocket = { version = "0.5.0-dev", path = "../lib" }
|