Files
pages/internal/server/dav_capabilities.go
Anya Tokugawa c1175d389f Implement Knowledge City platform, organizer and DAV integration
Capture accumulated application, UI, CLI, regression tests and design documentation changes, including task project mapping and default CalDAV list naming.

Keep deployment data, backups, local credentials and build artifacts out of Git. Move the Compose enrollment token to an ignored local environment file.
2026-09-27 14:44:43 +09:00

18 lines
698 B
Go

package server
import "net/http"
// calendar-access normally asserts RFC 4791 conformance, which our limited
// implementation does not provide. Only advertise it for an explicitly opted-in
// compatibility credential (e.g. OneTask's OPTIONS gate); never infer from UA.
func (s *Server) setDAVCapabilities(w http.ResponseWriter, r *http.Request, actor, credential string) {
w.Header().Set("DAV", "1")
if credential == "" {
return
}
if enabled, err := s.store.DAVCalendarAccessCompat(r.Context(), s.domainUUIDForRequest(r), actor, credential); err == nil && enabled {
w.Header().Set("DAV", "1, calendar-access")
w.Header().Set("X-PagesWiki-CalDAV-Profile", "limited-compatibility")
}
}