summaryrefslogtreecommitdiff
path: root/internal/api/security/robots.go
blob: 65056072a368c88eac9529014df2d179f857025d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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)
}