From 734114ee4d7cf81c6b2501fa3a1b62b0fecbef0d Mon Sep 17 00:00:00 2001 From: Sergey Matveev Date: Thu, 7 Oct 2021 14:08:40 +0300 Subject: [PATCH] More reliable and simpler PATH_INFO parse --- cmd/sgblog/http.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/sgblog/http.go b/cmd/sgblog/http.go index f81e38e..9f39171 100644 --- a/cmd/sgblog/http.go +++ b/cmd/sgblog/http.go @@ -171,8 +171,8 @@ func serveHTTP() { log.Fatalln(err) } - pathInfo, exists := os.LookupEnv("PATH_INFO") - if !exists { + pathInfo := os.Getenv("PATH_INFO") + if len(pathInfo) == 0 { pathInfo = "/" } queryValues, err := url.ParseQuery(os.Getenv("QUERY_STRING")) -- 2.44.0