Skip to content
Snippets Groups Projects
Unverified Commit d1e1794d authored by Max Adamo's avatar Max Adamo
Browse files

code refactoring

parent 46f563b5
No related branches found
No related tags found
No related merge requests found
...@@ -28,7 +28,7 @@ func init() { ...@@ -28,7 +28,7 @@ func init() {
ErrorLogger = log.New(os.Stdout, "ERROR: ", log.Ldate|log.Ltime) ErrorLogger = log.New(os.Stdout, "ERROR: ", log.Ldate|log.Ltime)
} }
// serve directory ipv6 // serve certificates list
func renderPage(w http.ResponseWriter, req *http.Request) { func renderPage(w http.ResponseWriter, req *http.Request) {
provider := strings.Split(req.URL.Path, "/") provider := strings.Split(req.URL.Path, "/")
serveFile := filepath.Join(webDir, req.URL.Path) serveFile := filepath.Join(webDir, req.URL.Path)
...@@ -43,14 +43,12 @@ func renderPage(w http.ResponseWriter, req *http.Request) { ...@@ -43,14 +43,12 @@ func renderPage(w http.ResponseWriter, req *http.Request) {
} }
w.WriteHeader(http.StatusOK) w.WriteHeader(http.StatusOK)
} }
fmt.Printf("test %s\n", serveFile)
http.ServeFile(w, req, serveFile) http.ServeFile(w, req, serveFile)
} }
// function redirect // function redirect
func redirect(w http.ResponseWriter, req *http.Request) { func redirect(w http.ResponseWriter, req *http.Request) {
redirectURL := filepath.Join(req.URL.Path, "/by_name.html") redirectURL := filepath.Join(req.URL.Path, "/by_name.html")
fmt.Printf("test %s\n", redirectURL)
http.Redirect(w, req, redirectURL, http.StatusMovedPermanently) http.Redirect(w, req, redirectURL, http.StatusMovedPermanently)
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment