mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-12-25 06:06:16 -06:00
[feature] Use ETag for robots.txt to prevent mishaps
This commit is contained in:
parent
c9de6c9a1e
commit
4e6874ac96
3 changed files with 10 additions and 1 deletions
|
|
@ -49,9 +49,13 @@ func (m *Module) Route(attachHandler func(method string, path string, f ...gin.H
|
|||
}
|
||||
|
||||
func (m *Module) robotsGETHandler(c *gin.Context) {
|
||||
const ETag = "\"" + apiutil.RobotsTxtETag + "\""
|
||||
c.Header("ETag", ETag)
|
||||
c.String(http.StatusOK, apiutil.RobotsTxt)
|
||||
}
|
||||
|
||||
func (m *Module) robotsGETHandlerDisallowNodeInfo(c *gin.Context) {
|
||||
const ETag = "\"" + apiutil.RobotsTxtDisallowNodeInfoETag + "\""
|
||||
c.Header("ETag", ETag)
|
||||
c.String(http.StatusOK, apiutil.RobotsTxtDisallowNodeInfo)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue