feat: fix hhu header
This commit is contained in:
parent
3bb46ef95a
commit
77dfa25c7f
1 changed files with 5 additions and 5 deletions
|
|
@ -8,6 +8,11 @@ import (
|
||||||
|
|
||||||
|
|
||||||
func Handler(w http.ResponseWriter, r *http.Request) {
|
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()
|
events, err := GetHhuComputerScienceEvent()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
w.WriteHeader(http.StatusInternalServerError)
|
w.WriteHeader(http.StatusInternalServerError)
|
||||||
|
|
@ -15,11 +20,6 @@ func Handler(w http.ResponseWriter, r *http.Request) {
|
||||||
}
|
}
|
||||||
|
|
||||||
w.WriteHeader(http.StatusOK)
|
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 := goics.NewICalEncode(w)
|
||||||
enc.Encode(events)
|
enc.Encode(events)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue