reorder stuff

trunk
Adam Veldhousen 3 years ago
parent d613ed0bfd
commit abc930908c
Signed by: adam
GPG Key ID: 6DB29003C6DD1E4B

@ -36,6 +36,7 @@ COPY --chown=gopherhole:gopherhole --from=build-server /build/.bin/gopherhole /o
USER gopherhole USER gopherhole
# host:port address for upstream dns server to do resolution on
ENV GOPHERHOLE_UPSTREAM="1.1.1.1:53" ENV GOPHERHOLE_UPSTREAM="1.1.1.1:53"
EXPOSE 53/udp 53/tcp 80/tcp EXPOSE 53/udp 53/tcp 80/tcp

@ -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 // TODO: smarter way https://github.com/go-chi/chi/issues/403
handler.Route("/api/v1", func(r chi.Router) { handler.Route("/api/v1", func(r chi.Router) {
r.Use(middleware.AllowContentType("application/json; utf-8", "application/json"))
r.Use(cors.Handler(cors.Options{ r.Use(cors.Handler(cors.Options{
AllowedOrigins: []string{"http://*", "https://*"}, AllowedOrigins: []string{"http://*", "https://*"},
AllowedMethods: []string{"GET", "PUT", "DELETE", "POST", "OPTIONS"}, 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, AllowCredentials: false,
MaxAge: 300, 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.SetHeader("Content-Type", "application/json; utf-8"))
r.Use(middleware.Timeout(time.Second * 5)) r.Use(middleware.Timeout(time.Second * 5))

Loading…
Cancel
Save