]> Cypherpunks.ru repositories - gocheese.git/blobdiff - hr.go
More convenient trusted-host
[gocheese.git] / hr.go
diff --git a/hr.go b/hr.go
index 687f4607e03c80e525ddfc656cab0606f8066605..c4531bd56f9697df031124f79aa2d787e7399f66 100644 (file)
--- a/hr.go
+++ b/hr.go
@@ -1,19 +1,17 @@
-/*
-GoCheese -- Python private package repository and caching proxy
-Copyright (C) 2019-2022 Sergey Matveev <stargrave@stargrave.org>
-
-This program is free software: you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation, version 3 of the License.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program.  If not, see <http://www.gnu.org/licenses/>.
-*/
+// GoCheese -- Python private package repository and caching proxy
+// Copyright (C) 2019-2024 Sergey Matveev <stargrave@stargrave.org>
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, version 3 of the License.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 package main
 
@@ -21,7 +19,6 @@ import (
        "bytes"
        _ "embed"
        "html/template"
-       "io/ioutil"
        "log"
        "net/http"
        "os"
@@ -40,7 +37,7 @@ var (
 )
 
 func serveHRRoot(w http.ResponseWriter, r *http.Request) {
-       files, err := ioutil.ReadDir(Root)
+       files, err := os.ReadDir(Root)
        if err != nil {
                log.Println("error", r.RemoteAddr, "hr-root", err)
                http.Error(w, err.Error(), http.StatusInternalServerError)