diff --git a/internal/mock_api/authentication/authentication.go b/internal/mock_api/authentication/authentication.go index 0c183203..6fb7ae3c 100644 --- a/internal/mock_api/authentication/authentication.go +++ b/internal/mock_api/authentication/authentication.go @@ -24,7 +24,6 @@ type UserAuthentication struct { func AuthenticationMiddleware(next mock_api.MockEndpoint) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "application/json") db := r.Context().Value("db").(database.CLIDatabase) // skip auth check for unsupported methods diff --git a/internal/mock_api/endpoints/schedule/ical.go b/internal/mock_api/endpoints/schedule/ical.go index ff087441..59d0713e 100644 --- a/internal/mock_api/endpoints/schedule/ical.go +++ b/internal/mock_api/endpoints/schedule/ical.go @@ -73,7 +73,7 @@ SUMMARY:TwitchDev Monthly Update // July 1, 2021 DESCRIPTION:Science & Technology. CATEGORIES:Science & Technology END:VEVENT -END:VCALENDAR%` - w.Header().Add("Content-Type", "text/calendar") +END:VCALENDAR` + w.Header().Set("Content-Type", "text/calendar") w.Write([]byte(body)) } diff --git a/internal/mock_api/mock_server/server.go b/internal/mock_api/mock_server/server.go index c69ff781..7bf2c748 100644 --- a/internal/mock_api/mock_server/server.go +++ b/internal/mock_api/mock_server/server.go @@ -100,6 +100,8 @@ func RegisterHandlers(m *http.ServeMux) { func loggerMiddleware(next http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { log.Printf("%v %v", r.Method, r.URL.Path) + w.Header().Set("Content-Type", "application/json") + next.ServeHTTP(w, r) }) }