diff --git a/.gitignore b/.gitignore index 98a7051b84acbbabce17cde94d86c19bbb090ef9..22ef502f7e6c6a3ac765f5a45c37e6e3e92e0716 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ Rocket.toml /target **/*.rs.bk +.mongo .env diff --git a/Cargo.lock b/Cargo.lock index 0f727d0e138e9a6f60d29f44e3c5998cd7a22254..9e7f881d9dc32de25b8aafc73710e211f09df987 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1960,7 +1960,7 @@ dependencies = [ [[package]] name = "revolt" -version = "0.2.11" +version = "0.3.0-alpha" dependencies = [ "bcrypt", "bitfield", diff --git a/Cargo.toml b/Cargo.toml index 79285f04a3e545236b8097f38d770a645f0c7909..23378f833ff02978e44b15410ed038cea32541fd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "revolt" -version = "0.2.11" +version = "0.3.0-alpha" authors = ["Paul Makles <paulmakles@gmail.com>"] edition = "2018" @@ -12,9 +12,9 @@ many-to-many = "0.1.2" #rauth = { git = "https://gitlab.insrt.uk/insert/rauth" } hive_pubsub = { version = "0.4.1", features = ["mongo"] } -rocket_cors = { git = "https://github.com/lawliet89/rocket_cors" } -rocket_contrib = { git = "https://github.com/SergioBenitez/Rocket" } -rocket = { git = "https://github.com/SergioBenitez/Rocket", default-features = false } +rocket_cors = { git = "https://github.com/lawliet89/rocket_cors", branch = "master" } +rocket_contrib = { git = "https://github.com/SergioBenitez/Rocket", branch = "master" } +rocket = { git = "https://github.com/SergioBenitez/Rocket", branch = "master", default-features = false } mongodb = { version = "1.1.1", features = ["tokio-runtime"], default-features = false } once_cell = "1.4.1" diff --git a/src/main.rs b/src/main.rs index c6f8ac22a46257eeda0481079eda2493a540c867..1f5d2bcea593c7a74c717506f3bb5bbb07f0a82a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -36,9 +36,11 @@ async fn main() { ..Default::default() } .to_cors() - .unwrap(); + .expect("Failed to create CORS."); routes::mount(rocket::ignite()) + .mount("/", rocket_cors::catch_all_options_routes()) + .manage(cors.clone()) .attach(cors) .launch() .await diff --git a/src/routes/root.rs b/src/routes/root.rs index cc38e8c547bb8855899abe0bc689cd2a8dfe37e4..a6fc7f58956751d422740286e7a67dc5e03f42a1 100644 --- a/src/routes/root.rs +++ b/src/routes/root.rs @@ -7,7 +7,7 @@ use mongodb::bson::doc; #[get("/")] pub async fn root() -> Response { Response::Success(json!({ - "revolt": "0.2.11", + "revolt": "0.3.0-alpha", "features": { "registration": !*DISABLE_REGISTRATION, "captcha": {