reduce bytes used on semrush
This commit is contained in:
parent
4d8858b846
commit
8d19048c0d
@ -56,7 +56,7 @@ var ErrNoRows = sql.ErrNoRows
|
||||
// TODO: Make this more customisable
|
||||
var SpammyDomainBits = []string{"porn", "sex", "lesbian", "acup", "nude", "milf", "tits", "vape", "busty", "kink", "lingerie", "strapon", "problog", "fet", "xblog", "blogin", "blognetwork", "relayblog"}
|
||||
|
||||
var Chrome, Firefox int // ! Temporary Hack for http push
|
||||
var Chrome, Firefox, Semrush int // ! Temporary Hack for http push and stopping semrush from wasting resources
|
||||
|
||||
type StringList []string
|
||||
|
||||
|
@ -789,6 +789,7 @@ func init() {
|
||||
co.SetReverseOSMapEnum(reverseOSMapEnum)
|
||||
c.Chrome = agentMapEnum["chrome"]
|
||||
c.Firefox = agentMapEnum["firefox"]
|
||||
c.Semrush = agentMapEnum["semrush"]
|
||||
}
|
||||
|
||||
type WriterIntercept struct {
|
||||
|
@ -470,6 +470,7 @@ func init() {
|
||||
co.SetReverseOSMapEnum(reverseOSMapEnum)
|
||||
c.Chrome = agentMapEnum["chrome"]
|
||||
c.Firefox = agentMapEnum["firefox"]
|
||||
c.Semrush = agentMapEnum["semrush"]
|
||||
}
|
||||
|
||||
type WriterIntercept struct {
|
||||
|
@ -119,7 +119,7 @@ func FootHeaders(w http.ResponseWriter, header *c.Header) {
|
||||
func renderTemplate3(tmplName, hookName string, w http.ResponseWriter, r *http.Request, h *c.Header, pi interface{}) error {
|
||||
s := h.Stylesheets
|
||||
h.Stylesheets = nil
|
||||
if r.FormValue("i") != "1" {
|
||||
if r.FormValue("i") != "1" && h.CurrentUser.LastAgent != c.Semrush {
|
||||
c.PrepResources(&h.CurrentUser, h, h.Theme)
|
||||
for _, ss := range s {
|
||||
h.Stylesheets = append(h.Stylesheets, ss)
|
||||
@ -131,7 +131,7 @@ func renderTemplate3(tmplName, hookName string, w http.ResponseWriter, r *http.R
|
||||
h.CurrentUser.LastAgent = 0
|
||||
}
|
||||
|
||||
if h.CurrentUser.Loggedin {
|
||||
if h.CurrentUser.Loggedin || h.CurrentUser.LastAgent == c.Semrush {
|
||||
h.MetaDesc = ""
|
||||
h.OGDesc = ""
|
||||
} else if h.MetaDesc != "" && h.OGDesc == "" {
|
||||
|
Loading…
Reference in New Issue
Block a user