aboutsummaryrefslogtreecommitdiffstats
path: root/robot.go
diff options
context:
space:
mode:
Diffstat (limited to 'robot.go')
-rw-r--r--robot.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/robot.go b/robot.go
new file mode 100644
index 0000000..7426eda
--- /dev/null
+++ b/robot.go
@@ -0,0 +1,17 @@
+package gopkgserver
+
+import (
+ "io"
+ "net/http"
+)
+
+func Robot() http.HandlerFunc {
+ robots := `User-agent: *
+Disallow: /
+`
+ return func(w http.ResponseWriter, r *http.Request) {
+ w.Header().Set("Cache-Control", "public, max-age=86400, immutable")
+ w.Header().Set("Content-Type", "text/plain")
+ io.WriteString(w, robots)
+ }
+}