diff options
author | Marc Pervaz Boocha <mboocha@sudomsg.com> | 2025-08-02 22:23:13 +0530 |
---|---|---|
committer | Marc Pervaz Boocha <mboocha@sudomsg.com> | 2025-08-02 23:02:30 +0530 |
commit | 178e0bfc2d8709ae4d3abd7519b260df09b2d3b5 (patch) | |
tree | 10cbdd013c62586190074d9f088e2269f88c4cab /robot.go | |
parent | Fixed Broken .gitignore (diff) | |
download | gopkgserver-main.tar gopkgserver-main.tar.gz gopkgserver-main.tar.bz2 gopkgserver-main.tar.lz gopkgserver-main.tar.xz gopkgserver-main.tar.zst gopkgserver-main.zip |
Diffstat (limited to '')
-rw-r--r-- | robot.go | 17 |
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) + } +} |