diff --git a/Dockerfile b/Dockerfile index a97c1a8..09d612b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -36,6 +36,7 @@ COPY --chown=gopherhole:gopherhole --from=build-server /build/.bin/gopherhole /o USER gopherhole +# host:port address for upstream dns server to do resolution on ENV GOPHERHOLE_UPSTREAM="1.1.1.1:53" EXPOSE 53/udp 53/tcp 80/tcp diff --git a/internal/http.go b/internal/http.go index 50dd2f4..bcad625 100644 --- a/internal/http.go +++ b/internal/http.go @@ -45,7 +45,6 @@ func NewAdminHandler(c Cache, s Storage, re *RuleEngine, content fs.FS) http.Han // TODO: smarter way https://github.com/go-chi/chi/issues/403 handler.Route("/api/v1", func(r chi.Router) { - r.Use(middleware.AllowContentType("application/json; utf-8", "application/json")) r.Use(cors.Handler(cors.Options{ AllowedOrigins: []string{"http://*", "https://*"}, AllowedMethods: []string{"GET", "PUT", "DELETE", "POST", "OPTIONS"}, @@ -53,6 +52,7 @@ func NewAdminHandler(c Cache, s Storage, re *RuleEngine, content fs.FS) http.Han AllowCredentials: false, MaxAge: 300, })) + r.Use(middleware.AllowContentType("application/json; utf-8", "application/json")) r.Use(middleware.SetHeader("Content-Type", "application/json; utf-8")) r.Use(middleware.Timeout(time.Second * 5))