Ver código fonte

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

DarthSim 1 ano atrás
pai
commit
11c6de9950
1 arquivos alterados com 4 adições e 1 exclusões
  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 {
 		if req.URL.Path == r.faviconRoute {
 			// TODO: Add a real favicon maybe?
 			// 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
 			return
 		}
 		}
 	}
 	}