mirror of https://github.com/rwf2/Rocket.git
fixup! Very simple CORS implementation
This commit is contained in:
parent
9d7ad109cd
commit
cb713c478d
|
@ -12,6 +12,7 @@ license = "MIT/Apache-2.0"
|
|||
|
||||
[features]
|
||||
default = ["json"]
|
||||
cors = []
|
||||
json = ["serde", "serde_json"]
|
||||
tera_templates = ["tera", "templates"]
|
||||
handlebars_templates = ["handlebars", "templates"]
|
||||
|
|
|
@ -40,6 +40,7 @@
|
|||
#[cfg(feature = "lazy_static_macro")]
|
||||
extern crate lazy_static;
|
||||
|
||||
#[cfg(feature = "cors")]
|
||||
mod cors;
|
||||
|
||||
#[cfg_attr(feature = "json", macro_use)]
|
||||
|
@ -52,6 +53,7 @@ mod templates;
|
|||
#[cfg(feature = "uuid")]
|
||||
mod uuid;
|
||||
|
||||
#[cfg(feature = "cors")]
|
||||
pub use cors::{PreflightCORS, CORS};
|
||||
|
||||
#[cfg(feature = "json")]
|
||||
|
|
|
@ -9,8 +9,9 @@ rocket = { path = "../../lib" }
|
|||
rocket_codegen = { path = "../../codegen" }
|
||||
|
||||
[dependencies.rocket_contrib]
|
||||
default-features = true
|
||||
default-features = false
|
||||
path = "../../contrib"
|
||||
features = ["cors"]
|
||||
|
||||
[dev-dependencies]
|
||||
rocket = { path = "../../lib", features = ["testing"] }
|
|
@ -17,6 +17,6 @@ fn hello() -> CORS<String> {
|
|||
|
||||
fn main() {
|
||||
rocket::ignite()
|
||||
.mount("/", routes![cors_preflight, hello])
|
||||
.mount("/", routes![hello])
|
||||
.launch();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue