minor stuff

This commit is contained in:
Lennart
2025-06-08 20:23:53 +02:00
parent ac1dbb29d8
commit bbe9113f5c
4 changed files with 16 additions and 12 deletions

View File

@@ -1,7 +1,8 @@
use crate::Error;
use crate::calendar::resource::{CalendarResource, CalendarResourceService};
use axum::extract::{Path, State};
use axum::response::Response;
use axum::response::{IntoResponse, Response};
use http::{HeaderMap, StatusCode, header};
use rustical_dav::privileges::UserPrivilege;
use rustical_dav::resource::Resource;
use rustical_dav_push::register::PushRegister;
@@ -72,10 +73,17 @@ pub async fn route_post<C: CalendarStore, S: SubscriptionStore>(
.upsert_subscription(subscription)
.await?;
let location = req
.resource_map()
.url_for(&req, "subscription", &[sub_id])
.unwrap();
// let location = req
// .resource_map()
// .url_for(&req, "subscription", &[sub_id])
// .unwrap();
//
let location = "asd";
Ok((
StatusCode::CREATED,
HeaderMap::from_iter([(header::LOCATION, location)]),
)
.into_response());
Ok(HttpResponse::Created()
.append_header((header::LOCATION, location.to_string()))

View File

@@ -343,7 +343,7 @@ impl<C: CalendarStore, S: SubscriptionStore> ResourceService for CalendarResourc
type Principal = User;
type PrincipalUri = CalDavPrincipalUri;
const DAV_HEADER: &str = "1, 3, access-control, calendar-access";
const DAV_HEADER: &str = "1, 3, access-control, calendar-access, webdav-push";
async fn get_resource(
&self,

View File

@@ -1,11 +1,8 @@
use crate::auth::User;
use super::AuthenticationProvider;
use axum::{extract::Request, response::Response};
use futures_core::future::BoxFuture;
use headers::{Authorization, HeaderMapExt, authorization::Basic};
use std::{
pin::Pin,
sync::Arc,
task::{Context, Poll},
};

View File

@@ -1,12 +1,11 @@
use crate::XmlError;
use crate::XmlRootTag;
use quick_xml::events::{BytesStart, Event};
use quick_xml::name::ResolveResult;
use std::io::BufRead;
pub use xml_derive::XmlDeserialize;
pub use xml_derive::XmlDocument;
use crate::XmlRootTag;
use crate::{XmlError, XmlSerialize};
pub trait XmlDeserialize: Sized {
fn deserialize<R: BufRead>(
reader: &mut quick_xml::NsReader<R>,