commit 146a0662ab689472de8600bc0585ee04271be547 Author: David Fifield david@bamsoftware.com Date: Sun May 19 23:48:46 2013 -0700
Handle robots.txt. --- appengine/fp-reg.go | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/appengine/fp-reg.go b/appengine/fp-reg.go index 107ec87..2ba6f10 100644 --- a/appengine/fp-reg.go +++ b/appengine/fp-reg.go @@ -10,6 +10,11 @@ import (
const BASE = "https://fp-facilitator.org/reg/"
+func robotsTxtHandler(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "text/plain; charset=utf-8") + w.Write([]byte("User-agent: *\nDisallow:\n")) +} + func ipHandler(w http.ResponseWriter, r *http.Request) { remoteAddr := r.RemoteAddr if net.ParseIP(remoteAddr).To4() == nil { @@ -32,6 +37,7 @@ func regHandler(w http.ResponseWriter, r *http.Request) { }
func init() { + http.HandleFunc("/robots.txt", robotsTxtHandler) http.HandleFunc("/ip", ipHandler) http.HandleFunc("/reg/", regHandler) }