From 065d22d6f4dd5c20e1738209383a6743e2557774 Mon Sep 17 00:00:00 2001 From: Andre Henriques Date: Mon, 10 Jul 2023 11:43:14 +0100 Subject: [PATCH] chore: add options --- src/main.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main.rs b/src/main.rs index 21da9c0..9f73de3 100644 --- a/src/main.rs +++ b/src/main.rs @@ -172,6 +172,12 @@ impl Fairing for CORS { } } +/// Catches all OPTION requests in order to get the CORS related Fairing triggered. +#[options("/<_..>")] +fn all_options() { + /* Intentionally left empty */ +} + #[rocket::main] async fn main() -> GResult { println!("Program start"); @@ -211,6 +217,7 @@ async fn main() -> GResult { .mount( "/", routes![ + all_options, index, quit, reload,