Pārlūkot izejas kodu

Respond with 404 and a single space to `/favicon.ico` requests

DarthSim 1 gadu atpakaļ
vecāks
revīzija
11c6de9950
1 mainītis faili ar 4 papildinājumiem un 1 dzēšanām
  1. 4 1
      router/router.go

+ 4 - 1
router/router.go

@@ -108,7 +108,10 @@ func (r *Router) ServeHTTP(rw http.ResponseWriter, req *http.Request) {
 
 		if req.URL.Path == r.faviconRoute {
 			// TODO: Add a real favicon maybe?
-			rw.WriteHeader(200)
+			rw.Header().Set("Content-Type", "text/plain")
+			rw.WriteHeader(404)
+			// Write a single byte to make AWS Lambda happy
+			rw.Write([]byte{' '})
 			return
 		}
 	}