summaryrefslogtreecommitdiffstats
path: root/robot.go
blob: 7426edaff3e4511d5f0e194c4c25c2c1ffdb71fb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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)
	}
}