summaryrefslogtreecommitdiff
path: root/internal/api/security/robots.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/api/security/robots.go')
-rw-r--r--internal/api/security/robots.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/internal/api/security/robots.go b/internal/api/security/robots.go
new file mode 100644
index 000000000..65056072a
--- /dev/null
+++ b/internal/api/security/robots.go
@@ -0,0 +1,17 @@
+package security
+
+import (
+ "net/http"
+
+ "github.com/gin-gonic/gin"
+)
+
+const robotsString = `User-agent: *
+Disallow: /
+`
+
+// RobotsGETHandler returns the most restrictive possible robots.txt file in response to a call to /robots.txt.
+// The response instructs bots with *any* user agent not to index the instance at all.
+func (m *Module) RobotsGETHandler(c *gin.Context) {
+ c.String(http.StatusOK, robotsString)
+}