From 77dfa25c7ff44a3289a027de44b5ac323bfe33a6 Mon Sep 17 00:00:00 2001 From: cato-001 Date: Mon, 5 Jan 2026 13:26:21 +0100 Subject: [PATCH] feat: fix hhu header --- src/hhu/handler.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/hhu/handler.go b/src/hhu/handler.go index a6671bd..e49bcbf 100644 --- a/src/hhu/handler.go +++ b/src/hhu/handler.go @@ -8,6 +8,11 @@ import ( func Handler(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-type", "text/calendar") + w.Header().Set("charset", "utf-8") + w.Header().Set("Content-Disposition", "inline") + w.Header().Set("filename", "calendar.ics") + events, err := GetHhuComputerScienceEvent() if err != nil { w.WriteHeader(http.StatusInternalServerError) @@ -15,11 +20,6 @@ func Handler(w http.ResponseWriter, r *http.Request) { } w.WriteHeader(http.StatusOK) - header := w.Header() - header.Set("Content-type", "text/calendar") - header.Set("charset", "utf-8") - header.Set("Content-Disposition", "inline") - header.Set("filename", "calendar.ics") enc := goics.NewICalEncode(w) enc.Encode(events) }