mirror of
https://github.com/lennart-k/rustical.git
synced 2025-12-13 22:52:22 +00:00
minor stuff
This commit is contained in:
@@ -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()))
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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},
|
||||
};
|
||||
|
||||
@@ -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>,
|
||||
|
||||
Reference in New Issue
Block a user