1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-19 05:09:42 +02:00

Reduce meta endpoint logging

This commit is contained in:
Harvey Kandola 2019-04-26 16:18:50 +01:00
parent c666e68c2b
commit 86a4e82c12

View file

@ -13,6 +13,7 @@ package meta
import (
"bytes"
"database/sql"
"encoding/base64"
"fmt"
"net/http"
@ -78,17 +79,20 @@ func (h *Handler) RobotsTxt(w http.ResponseWriter, r *http.Request) {
method := "GetRobots"
ctx := domain.GetRequestContext(r)
dom := organization.GetSubdomainFromHost(r)
o, err := h.Store.Organization.GetOrganizationByDomain(dom)
// default is to deny
robots :=
`User-agent: *
Disallow: /
`
dom := organization.GetSubdomainFromHost(r)
o, err := h.Store.Organization.GetOrganizationByDomain(dom)
if err != nil {
h.Runtime.Log.Info(fmt.Sprintf("%s failed to get Organization for domain %s", method, dom))
if err != sql.ErrNoRows {
// Log error if query was not empty
h.Runtime.Log.Info(fmt.Sprintf("%s failed to get Organization for domain %s", method, dom))
}
o = org.Organization{}
o.AllowAnonymousAccess = false
}