mirror of
https://github.com/documize/community.git
synced 2025-07-20 13:49:42 +02:00
Reduce meta endpoint logging
This commit is contained in:
parent
c666e68c2b
commit
86a4e82c12
1 changed files with 8 additions and 4 deletions
|
@ -13,6 +13,7 @@ package meta
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
|
"database/sql"
|
||||||
"encoding/base64"
|
"encoding/base64"
|
||||||
"fmt"
|
"fmt"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
@ -78,17 +79,20 @@ func (h *Handler) RobotsTxt(w http.ResponseWriter, r *http.Request) {
|
||||||
method := "GetRobots"
|
method := "GetRobots"
|
||||||
ctx := domain.GetRequestContext(r)
|
ctx := domain.GetRequestContext(r)
|
||||||
|
|
||||||
dom := organization.GetSubdomainFromHost(r)
|
|
||||||
o, err := h.Store.Organization.GetOrganizationByDomain(dom)
|
|
||||||
|
|
||||||
// default is to deny
|
// default is to deny
|
||||||
robots :=
|
robots :=
|
||||||
`User-agent: *
|
`User-agent: *
|
||||||
Disallow: /
|
Disallow: /
|
||||||
`
|
`
|
||||||
|
|
||||||
|
dom := organization.GetSubdomainFromHost(r)
|
||||||
|
o, err := h.Store.Organization.GetOrganizationByDomain(dom)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
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))
|
h.Runtime.Log.Info(fmt.Sprintf("%s failed to get Organization for domain %s", method, dom))
|
||||||
|
}
|
||||||
o = org.Organization{}
|
o = org.Organization{}
|
||||||
o.AllowAnonymousAccess = false
|
o.AllowAnonymousAccess = false
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue