Skip to content

Commit 7bc656e

Browse files
committed
Set X-Robots-Tag for Drawbridge domain
1 parent 02f440d commit 7bc656e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drawbridge.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ const (
6262
contentTypeTextHTML = "text/html"
6363
contentTypeJSON = "application/json"
6464
hstsValue = "max-age=31536000; includeSubDomains"
65+
robotsNone = "noindex, nofollow"
6566

6667
headerAllow = "Allow"
6768
headerCacheControl = "Cache-Control"
@@ -71,6 +72,7 @@ const (
7172
headerOrigin = "Origin"
7273
headerSetCookie = "Set-Cookie"
7374
headerHSTS = "Strict-Transport-Security"
75+
headerRobots = "X-Robots-Tag"
7476

7577
headerRequestID = "X-Drawbridge-Request-ID"
7678
headerUser = "X-Drawbridge-User"
@@ -337,6 +339,8 @@ func (h *handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
337339
rw.Header().Set(headerHSTS, hstsValue)
338340

339341
if host == h.cfg.DomainDrawbridge {
342+
rw.Header().Set(headerRobots, robotsNone)
343+
340344
rc := http.NewResponseController(w)
341345
_ = rc.SetReadDeadline(time.Now().Add(httpInternalReadTimeout))
342346
defer rc.SetReadDeadline(time.Time{})

0 commit comments

Comments
 (0)