fix:#16 added userAgent and fixed logging for room ical

This commit is contained in:
Elmar Kresse
2024-11-18 21:20:45 +01:00
parent 86a6820038
commit 4809192570
3 changed files with 6 additions and 7 deletions

View File

@@ -123,8 +123,9 @@ func AddFeedRoutes(app model.AppType) {
app.Fiber.Get("/api/feed/room", func(c fiber.Ctx) error {
room := c.Query("id")
ifNoneMatch := c.Get("If-None-Match")
userAgent := c.Get("User-Agent")
results, etag, err := ical.FeedRoom(app, room)
results, etag, err := ical.FeedRoom(app, room, userAgent)
if err != nil {
slog.Error("Failed to get feed", "error", err, "room", room)
return c.SendStatus(fiber.StatusNotFound)
@@ -144,10 +145,12 @@ func AddFeedRoutes(app model.AppType) {
app.Fiber.Head("/api/feed", func(c fiber.Ctx) error {
return c.JSON(http.StatusOK, "")
})
app.Fiber.Head("/api/feed/room", func(c fiber.Ctx) error { return c.JSON(http.StatusOK, "") })
app.Fiber.Add([]string{"PROPFIND"}, "/api/feed", func(c fiber.Ctx) error {
return c.JSON(http.StatusOK, "")
})
app.Fiber.Add([]string{"PROPFIND"}, "/api/feed/room", func(c fiber.Ctx) error { return c.JSON(http.StatusOK, "") })
// Route for Thunderbird to get calendar server information
// Response is a 200 OK without additional content