From 1a4c98c93ed6cffa94211958fa1efae21955f608 Mon Sep 17 00:00:00 2001 From: Daniel Date: Tue, 1 Jun 2021 12:57:01 +0200 Subject: [PATCH 1/2] Disable dns prefetch via HTTP header --- api/router.go | 1 + 1 file changed, 1 insertion(+) diff --git a/api/router.go b/api/router.go index 6fbcacd..c6efec9 100644 --- a/api/router.go +++ b/api/router.go @@ -150,6 +150,7 @@ func (mh *mainHandler) handle(w http.ResponseWriter, r *http.Request) error { w.Header().Set("X-Content-Type-Options", "nosniff") w.Header().Set("X-Frame-Options", "deny") w.Header().Set("X-XSS-Protection", "1; mode=block") + w.Header().Set("X-DNS-Prefetch-Control", "off") } else { w.Header().Set("Access-Control-Allow-Origin", "*") } From bd46a92359b5f6d3c6e62f2fa9d7365fa9f410ec Mon Sep 17 00:00:00 2001 From: Daniel Date: Tue, 1 Jun 2021 12:57:07 +0200 Subject: [PATCH 2/2] Fix typo --- api/endpoints.go | 2 +- api/router.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/api/endpoints.go b/api/endpoints.go index 7934dcd..8eafa44 100644 --- a/api/endpoints.go +++ b/api/endpoints.go @@ -272,7 +272,7 @@ func (e *Endpoint) ServeHTTP(w http.ResponseWriter, r *http.Request) { // Wait for the owning module to be ready. if !moduleIsReady(e.BelongsTo) { - http.Error(w, "The API endpoint not ready yet. Please try again later.", http.StatusServiceUnavailable) + http.Error(w, "The API endpoint is not ready yet. Please try again later.", http.StatusServiceUnavailable) return } diff --git a/api/router.go b/api/router.go index c6efec9..ac91c40 100644 --- a/api/router.go +++ b/api/router.go @@ -133,7 +133,7 @@ func (mh *mainHandler) handle(w http.ResponseWriter, r *http.Request) error { // Wait for the owning module to be ready. if moduleHandler, ok := handler.(ModuleHandler); ok { if !moduleIsReady(moduleHandler.BelongsTo()) { - http.Error(lrw, "The API endpoint not ready yet. Please try again later.", http.StatusServiceUnavailable) + http.Error(lrw, "The API endpoint is not ready yet. Please try again later.", http.StatusServiceUnavailable) return nil } }