Files
rustical/crates/carddav/src/lib.rs
2024-07-27 12:11:45 +02:00

25 lines
702 B
Rust

use actix_web::{web, HttpResponse, Responder};
use rustical_auth::CheckAuthentication;
use std::sync::Arc;
pub fn configure_well_known(cfg: &mut web::ServiceConfig, carddav_root: String) {
cfg.service(web::redirect("/carddav", carddav_root).permanent());
}
pub fn configure_dav<A: CheckAuthentication>(
_cfg: &mut web::ServiceConfig,
_prefix: String,
_auth: Arc<A>,
) {
}
pub async fn options_handler() -> impl Responder {
HttpResponse::Ok()
.insert_header((
"Allow",
"OPTIONS, GET, HEAD, POST, PUT, REPORT, PROPFIND, PROPPATCH, MKCOL",
))
.insert_header(("DAV", "1, 2, 3, addressbook, extended-mkcol"))
.body("options")
}