adds human.txt, site.txt, and 404.html
This commit is contained in:
@@ -38,6 +38,7 @@ var validFiles map[string]string = map[string]string{
|
||||
"/favicon-16x16.png": TYPE_IMAGE_PNG,
|
||||
"/favicon-32x32.png": TYPE_IMAGE_PNG,
|
||||
"/favicon.ico": TYPE_IMAGE_PNG,
|
||||
"/human.txt": TYPE_TEXT_PLAIN,
|
||||
"/js/bootstrap.bundle.min.js.map": TYPE_APPLICATION_JSON,
|
||||
"/js/bootstrap.bundle.min.js": TYPE_TEXT_JS,
|
||||
"/js/jquery.min.js": TYPE_TEXT_JS,
|
||||
@@ -140,7 +141,7 @@ func webJSON(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
cves := cisa.Read()
|
||||
if len(cves.Vulnerabilities) == 0 {
|
||||
w.Write([]byte("{}"))
|
||||
w.Write([]byte("{}")) //nolint:errcheck
|
||||
return
|
||||
} else if len(cves.Vulnerabilities) < 3 {
|
||||
num = len(cves.Vulnerabilities)
|
||||
@@ -150,7 +151,7 @@ func webJSON(w http.ResponseWriter, r *http.Request) {
|
||||
config.Cfg.Log.Debug("unable to convert CVES to JSON", "error", err, "url", r.URL.Path)
|
||||
}
|
||||
|
||||
w.Write(output)
|
||||
w.Write(output) //nolint:errcheck
|
||||
}
|
||||
|
||||
func webTXT(w http.ResponseWriter, r *http.Request) {
|
||||
@@ -159,4 +160,6 @@ func webTXT(w http.ResponseWriter, r *http.Request) {
|
||||
tmpltError(w, http.StatusBadRequest, "Invalid http method.")
|
||||
return
|
||||
}
|
||||
|
||||
tmpltTXT(w)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user