From 5bea98763524943b0577d57b9dbb00722fc048ab Mon Sep 17 00:00:00 2001 From: Massimiliano Adamo <maxadamo@gmail.com> Date: Thu, 12 May 2022 01:20:19 +0200 Subject: [PATCH] added missing pages --- main.go | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/main.go b/main.go index 591628a..69a449e 100644 --- a/main.go +++ b/main.go @@ -29,7 +29,7 @@ func init() { ErrorLogger = log.New(os.Stdout, "ERROR: ", log.Ldate|log.Ltime) } -// serve certificates list +// serve certificates JSON func renderJSON(w http.ResponseWriter, req *http.Request) { provider := strings.Split(req.URL.Path, "/")[2] serveFile := fmt.Sprintf("%v/%v/%v.json", webDir, provider, provider) @@ -42,7 +42,7 @@ func renderJSON(w http.ResponseWriter, req *http.Request) { if verboseBool { InfoLogger.Printf("HTTP Status %v", http.StatusOK) } - w.Header().Set("Content-Type", "application/json; charset=utf-8") + w.Header().Set("Content-Type", "application/json") } http.ServeFile(w, req, serveFile) } @@ -60,7 +60,7 @@ func renderPage(w http.ResponseWriter, req *http.Request) { if verboseBool { InfoLogger.Printf("HTTP Status %v", http.StatusOK) } - w.Header().Set("Content-Type", "text/html; charset=utf-8") + w.Header().Set("Content-Type", "text/html") } http.ServeFile(w, req, serveFile) } @@ -110,9 +110,12 @@ Options: baseURLs := [6]string{"/sectigo_ev", "/sectigo_ov", "/letsencrypt", "/sectigo_ev/", "/sectigo_ov/", "/letsencrypt/"} apiURLs := [6]string{"/api/sectigo_ev", "/api/sectigo_ov", "/api/letsencrypt", "/api/sectigo_ev/", "/api/sectigo_ov/", "/api/letsencrypt/"} - otherURLs := [6]string{"/letsencrypt/by_name.html", "/letsencrypt/by_date.html", + otherURLs := [12]string{"/letsencrypt/by_name.html", "/letsencrypt/by_date.html", + "/letsencrypt/letsencrypt.json", "/letsencrypt/letsencrypt_expired.json", "/sectigo_ov/by_name.html", "/sectigo_ov/by_date.html", - "/sectigo_ev/by_name.html", "/sectigo_ev/by_date.html"} + "/sectigo_ov/sectigo_ov.json", "/sectigo_ov/sectigo_ov_expired.json", + "/sectigo_ev/by_name.html", "/sectigo_ev/by_date.html", + "/sectigo_ev/sectigo_ev.json", "/sectigo_ev/sectigo_ev_expired.json"} fs := http.FileServer(http.Dir("/var/www/acme_web/static")) http.Handle("/static/", http.StripPrefix("/static/", fs)) -- GitLab