summaryrefslogtreecommitdiffstats
path: root/main.go
diff options
context:
space:
mode:
authorsiddharth ravikumar <s@ricketyspace.net>2022-06-18 10:57:57 -0400
committersiddharth ravikumar <s@ricketyspace.net>2022-06-18 18:46:36 -0400
commitacca93c13433d9cc7a2798b9b03fbb285046fc25 (patch)
tree92c97fda750ef2185114de2431b6748bc80deb49 /main.go
parent36b64e59db9134a94d7b5b7dcad214f2b00faf39 (diff)
peach: remove `logRequest`
Not needed.
Diffstat (limited to 'main.go')
-rw-r--r--main.go16
1 files changed, 0 insertions, 16 deletions
diff --git a/main.go b/main.go
index 79071e8..7d111d6 100644
--- a/main.go
+++ b/main.go
@@ -61,8 +61,6 @@ func main() {
}
func defaultHandler(w http.ResponseWriter, r *http.Request) {
- logRequest(r)
-
if r.URL.Path == "/" {
http.Redirect(w, r, "/41.115,-83.177", 302)
return
@@ -105,8 +103,6 @@ func showWeather(w http.ResponseWriter, lat, lng float32) {
}
func showMeta(w http.ResponseWriter, r *http.Request) {
- logRequest(r)
-
// Make meta info.
meta := meta.NewMeta()
@@ -119,8 +115,6 @@ func showMeta(w http.ResponseWriter, r *http.Request) {
}
func serveStaticFile(w http.ResponseWriter, r *http.Request) {
- logRequest(r)
-
// Add Cache-Control header
w.Header().Set("Cache-Control", "max-age=604800")
@@ -130,8 +124,6 @@ func serveStaticFile(w http.ResponseWriter, r *http.Request) {
}
func showSearch(w http.ResponseWriter, r *http.Request) {
- logRequest(r)
-
search, err, status := search.NewSearch(r)
if err != nil && status == 404 {
http.NotFound(w, r)
@@ -147,11 +139,3 @@ func showSearch(w http.ResponseWriter, r *http.Request) {
return
}
}
-
-func logRequest(r *http.Request) {
- addr := r.RemoteAddr
- if len(r.Header.Get("X-Forwarded-For")) > 0 {
- addr = r.Header.Get("X-Forwarded-For")
- }
- log.Printf("%v - %v - %v", addr, r.URL, r.Header.Get("User-agent"))
-}