"tokio-util 0.7.0",
]
+[[package]]
+name = "actix-cors"
+version = "0.6.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "414360eed71ba2d5435b185ba43ecbe281dfab5df3898286d6b7be8074372c92"
+dependencies = [
+ "actix-utils",
+ "actix-web",
+ "derive_more",
+ "futures-util",
+ "log 0.4.16",
+ "once_cell",
+ "smallvec",
+]
+
[[package]]
name = "actix-files"
version = "0.6.0"
name = "otter-daemon"
version = "0.7.3"
dependencies = [
+ "actix-cors",
"actix-files",
"actix-web",
"fehler",
actix-web = "4"
actix-files = "0.6"
+actix-cors = "0.6"
rocket = { version="^0.4.6", features=["sse"] }
rocket_contrib = { version="0.4", default-features=false, features=["tera_templates", "helmet", "json", "serve"] }
use actix_web::HttpResponse;
use actix_web::dev::Payload;
use actix_web::middleware;
+use actix_cors::Cors;
use std::convert::Infallible;
format!("Hello {:?}", remain)
}
+fn update_cors() -> Cors {
+ Cors::default()
+ .allowed_methods([Method::GET])
+
+}
+
//#[route("/wombat", method="GET", method="HEAD")]
-#[route("/foo", method="GET", method="HEAD")]
+#[route("/foo", method="GET", method="HEAD",
+ wrap = "update_cors()")]
//#[get("/foo")]
async fn foo() -> impl Responder {
"foo\r\n"